diff options
author | Joshua Yun <joshua@joshuayun.com> | 2025-03-15 17:35:52 -0500 |
---|---|---|
committer | Joshua Yun <joshua@joshuayun.com> | 2025-03-15 17:35:52 -0500 |
commit | 59fd8c25ee1452452cb564d6fe4163b7a9394aef (patch) | |
tree | 028688a39cd401a40939d86e3bf4a8f5d678d6a4 /primitives/rtl/AFF.sv | |
parent | c7a29c00b143ff6ee22bb7cffbdd0ae7c21206d1 (diff) | |
download | riscv-processor-59fd8c25ee1452452cb564d6fe4163b7a9394aef.tar.gz |
feat: added TB support + primitives for flipflops, initial fetch stage (not complete), mem initialization for imem complete
Diffstat (limited to 'primitives/rtl/AFF.sv')
-rw-r--r-- | primitives/rtl/AFF.sv | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/primitives/rtl/AFF.sv b/primitives/rtl/AFF.sv new file mode 100644 index 0000000..15789bf --- /dev/null +++ b/primitives/rtl/AFF.sv @@ -0,0 +1,19 @@ +// AFF # ( .WIDTH/.DTYPE() ) ff_ ( .q(), .d(), .en(), .clk() ); +module AFF +#( + parameter WIDTH = 1, + parameter type DTYPE = logic [WIDTH-1:0] +) +( + input logic clk, + input logic en, + + input DTYPE d, + output DTYPE q +); + +always_ff @(posedge clk) begin + if (en) q <= d; +end + +endmodule |