Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import StmtFSM :: *;
- interface CRegCounter;
- method Action up(Int#(32) v);
- method Action down(Int#(32) v);
- method Action reset();
- method Int#(32) getCounter();
- endinterface
- module mkCounter(CRegCounter);
- Reg#(Int#(32)) ctr[4] <- mkCReg(4, 0);
- method Action up(Int#(32) v);
- ctr[0] <= ctr[0] + v;
- endmethod
- method Action down(Int#(32) v);
- ctr[1] <= ctr[1] - v;
- endmethod
- method Action reset();
- ctr[2] <= 0;
- endmethod
- method Int#(32) getCounter();
- return ctr[3];
- endmethod
- endmodule
- module mkCtrTestbench(Empty);
- CRegCounter uut <- mkCounter();
- Stmt teststmt = {
- seq
- action
- uut.up(32);
- uut.down(11);
- $display("Counter is: %d", uut.getCounter());
- endaction
- endseq
- };
- mkAutoFSM(teststmt);
- endmodule
- Console Dump:
- ----------------------------------------------------------------------------
- bsc -u -sim -g mkCtrTestbench CRegCounter.bsv checking package dependencies
- compiling CRegCounter.bsv
- code generation for mkCtrTestbench starts
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port0__write(...)
- and
- uut_ctr.port1__write(...)
- For the complete expressions use the flag `-show-range-conflict'.
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port0__write(...)
- and
- uut_ctr.port1__read()
- For the complete expressions use the flag `-show-range-conflict'.
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port0__write(...)
- and
- uut_ctr.port3__read()
- For the complete expressions use the flag `-show-range-conflict'.
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port0__read()
- and
- uut_ctr.port1__write(...)
- For the complete expressions use the flag `-show-range-conflict'.
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port0__read()
- and
- uut_ctr.port1__read()
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port0__read()
- and
- uut_ctr.port3__read()
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port1__write(...)
- and
- uut_ctr.port3__read()
- For the complete expressions use the flag `-show-range-conflict'.
- Error: "CRegCounter.bsv", line 40, column 25: (G0004)
- Rule `RL_action_l40c25' uses methods that conflict in parallel:
- uut_ctr.port1__read()
- and
- uut_ctr.port3__read()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement