File: inject_path_sub.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 (21 lines) | stat: -rw-r--r-- 456 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
// Note module names don't match, this is intentional to check the .f file

module reg_core (
  output logic [7:0] q,
  input  logic [7:0] d,
  input  logic       clk, rst_n
  );

  always_ff @(posedge clk or negedge rst_n)
    if (!rst_n) q <= '0;
    else        q <= d;
endmodule

module register (
  output logic [7:0] q,
  input  logic [7:0] d,
  input  logic       clk, rst_n
  );
  
  reg_core c1 (.q(q), .d(d), .clk(clk), .rst_n(rst_n));
endmodule