File: autosense_mcardle_onehot.v

package info (click to toggle)
verilog-mode 20161124.fd230e6-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 3,764 kB
  • ctags: 5,143
  • sloc: lisp: 12,430; perl: 293; makefile: 146; sh: 35; fortran: 2
file content (28 lines) | stat: -rw-r--r-- 841 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module x;
   
   input [5:0]  state;
   output [5:0] next;
   
   parameter    CYCLEA  = 1;
   parameter    CYCLEC  = 2;
   parameter    MSTRA  = 3;
   parameter    MSTRB  = 4;
   parameter    MSTRC  = 5;
   
   // make sure 'state' is listed
   always @ (/*AUTOSENSE*/done or nREQA or nREQB or nREQC or state) begin
      next  = 6'b0;
      case (1'b1)
        state[CYCLEC] : begin
           if (!nREQA && done)                         next[MSTRA]  = 1'b1;
           else if (!nREQB && nREQA && done)next[MSTRB]  = 1'b1;
           else if (!nREQC && nREQA && nREQB && done) next[MSTRC]  = 1'b1;
           else next[CYCLEC]  = 1'b1;
        end
        state[MSTRA] : begin
           if (!nREQB || !nREQC) next[CYCLEA]  = 1'b1;
           else                           next[MSTRA]  = 1'b1;
        end
      endcase
   end
endmodule