File: autoreset_if.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 (74 lines) | stat: -rw-r--r-- 1,729 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//From: "Chris Kappler" <ckappler@hhnetwk.com>

//Verilint 440 off // WARNING: Clock is used as a reset
//Verilint 394 off // WARNING: Multiple clocks in the always block
//Verilint  71 off // WARNING: Case statement without default clause

module x (/*AUTOARG*/
          // Outputs
          a, b, c,
          // Inputs
          clk, reset_l, in_a, in_b, in_c
          );
   
   input  clk, reset_l, in_a,in_b,in_c;
   output a,b,c;
   reg    a,b,c;
   
   always @(posedge clk or negedge reset_l) begin
      if (!reset_l) begin
         c <= 1;
         /*AUTORESET*/
         // Beginning of autoreset for uninitialized flops
         a <= #1 0;
         b <= #1 0;
         // End of automatics
      end
      else begin
         a <= in_a;
         b <= in_b;
         c <= in_c;
      end
   end
   
   always @(posedge clk or negedge reset_l) begin
      casex ({reset_l,in_a})
        2'b1_x: begin
           a <= in_a;
           b <= in_b;
           c <= in_c;
        end
        2'b0_x: begin
           c <= 1;
           /*AUTORESET*/
           // Beginning of autoreset for uninitialized flops
           a <= #1 0;
           b <= #1 0;
           // End of automatics
        end
      endcase
   end
   
   always @(/*AS*/in_a or in_b or reset_l) begin
      casex ({reset_l,in_a})
        2'b1_x: begin
           a  = in_a;
           b  = in_b;
        end
        2'b0_x: begin
           c  = 1;
           /*AUTORESET*/
           // Beginning of autoreset for uninitialized flops
           a  = 0;
           b  = 0;
           // End of automatics
        end
      endcase
   end
   
endmodule

// Local Variables:
// verilog-auto-reset-widths: nil
// verilog-assignment-delay: "#1 "
// End: