File: register.v

package info (click to toggle)
tkgate 2.1%2Brepack-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,436 kB
  • sloc: ansic: 62,300; tcl: 20,345; xml: 2,731; yacc: 1,177; lex: 839; sh: 701; makefile: 187; perl: 39
file content (20 lines) | stat: -rw-r--r-- 485 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module register #(.Dsetup(1), .Dhold(1), .Dck_q(1)) (Q, D, EN, CLR, CK);
  input CK,EN,CLR;
  input ${DQ_RANGE} D;
  output ${DQ_RANGE} Q;
  reg 	 ${DQ_RANGE} Qreg;
 
  specify
      $setup(D,posedge CK &&& (!EN && CLR), Dsetup);
      $hold(posedge CK &&& (!EN && CLR),D, Dhold);
  endspecify

  assign #Dck_q Q = ${invQ}Qreg;

  always @(posedge CK or negedge CLR)
    if (CLR === 1'b0)
      Qreg = ${DQ_BITS}'b0;
    else if (CK === 1'b1 && EN === 1'b0)
      Qreg = D;

endmodule