-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add braces to some if-stmts in generated Bluesim C++
to avoid warnings about ambiguous 'else'
- Loading branch information
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
|
||
ActionValue #(Bit #(32)) cur_cycle = actionvalue | ||
Bit #(32) t <- $stime; | ||
if (genVerilog) | ||
t = t + 5; | ||
return t / 10; | ||
endactionvalue; | ||
|
||
(* synthesize *) | ||
module sysNestedIfBraces (); | ||
|
||
Reg #(Bit #(4)) cfg_verbosity <- mkReg (1); | ||
|
||
Reg #(Bool) rg_state <- mkReg (False); | ||
|
||
rule rl_display (! rg_state); | ||
if (cfg_verbosity != 0) | ||
$display ("%0d: display", cur_cycle); | ||
rg_state <= True; | ||
endrule | ||
|
||
rule rl_finish (rg_state); | ||
$finish (0); | ||
endrule | ||
|
||
endmodule | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
testsuite/bsc.bluesim/misc/sysNestedIfBraces.bsc-ccomp-out.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Bluesim object created: sysNestedIfBraces.{h,o} | ||
Bluesim object created: model_sysNestedIfBraces.{h,o} | ||
Simulation shared library created: sysNestedIfBraces.cexe.so | ||
Simulation executable created: sysNestedIfBraces.cexe |