Guest User

Untitled

a guest
Feb 19th, 2017
200
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import StmtFSM :: *;
  2.  
  3. interface CRegCounter;
  4.     method Action up(Int#(32) v);
  5.     method Action down(Int#(32) v);
  6.     method Action reset();
  7.     method Int#(32) getCounter();
  8. endinterface
  9.  
  10. module mkCounter(CRegCounter);
  11.  
  12.     Reg#(Int#(32)) ctr[4] <- mkCReg(4, 0);
  13.    
  14.     method Action up(Int#(32) v);
  15.         ctr[0] <= ctr[0] + v;
  16.     endmethod
  17.    
  18.     method Action down(Int#(32) v);
  19.         ctr[1] <= ctr[1] - v;
  20.     endmethod
  21.    
  22.     method Action reset();
  23.         ctr[2] <= 0;
  24.     endmethod
  25.    
  26.     method Int#(32) getCounter();
  27.         return ctr[3]; 
  28.     endmethod
  29.        
  30. endmodule
  31.  
  32. module mkCtrTestbench(Empty);
  33.  
  34. CRegCounter uut <- mkCounter();
  35.  
  36.     Stmt teststmt = {
  37.         seq
  38.             action
  39.                 uut.up(32);
  40.                 uut.down(11);
  41.                 $display("Counter is: %d", uut.getCounter());
  42.             endaction  
  43.         endseq     
  44.     };
  45.    
  46.     mkAutoFSM(teststmt);
  47. endmodule
  48.  
  49.  
  50.  
  51.  
  52.  
  53. Console Dump:
  54. ----------------------------------------------------------------------------
  55.  
  56. bsc -u -sim -g mkCtrTestbench CRegCounter.bsv  checking package dependencies
  57. compiling CRegCounter.bsv
  58. code generation for mkCtrTestbench starts
  59. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  60.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  61.     uut_ctr.port0__write(...)
  62.   and
  63.     uut_ctr.port1__write(...)
  64.   For the complete expressions use the flag `-show-range-conflict'.
  65. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  66.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  67.     uut_ctr.port0__write(...)
  68.   and
  69.     uut_ctr.port1__read()
  70.   For the complete expressions use the flag `-show-range-conflict'.
  71. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  72.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  73.     uut_ctr.port0__write(...)
  74.   and
  75.     uut_ctr.port3__read()
  76.   For the complete expressions use the flag `-show-range-conflict'.
  77. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  78.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  79.     uut_ctr.port0__read()
  80.   and
  81.     uut_ctr.port1__write(...)
  82.   For the complete expressions use the flag `-show-range-conflict'.
  83. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  84.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  85.     uut_ctr.port0__read()
  86.   and
  87.     uut_ctr.port1__read()
  88. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  89.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  90.     uut_ctr.port0__read()
  91.   and
  92.     uut_ctr.port3__read()
  93. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  94.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  95.     uut_ctr.port1__write(...)
  96.   and
  97.     uut_ctr.port3__read()
  98.   For the complete expressions use the flag `-show-range-conflict'.
  99. Error: "CRegCounter.bsv", line 40, column 25: (G0004)
  100.   Rule `RL_action_l40c25' uses methods that conflict in parallel:
  101.     uut_ctr.port1__read()
  102.   and
  103.     uut_ctr.port3__read()
RAW Paste Data