verilog_data-1 / The-OpenROAD-Project_OpenROAD-flow-scripts /flow /designs /src /tinyRocket /AsyncResetReg.v
Add batch 5 (Luthiraa_TALOS-V2, dawsonjon_fpu, The-OpenROAD-Project_OpenROAD-flow-scripts, antonblanchard_microwatt, alexforencich_verilog-i2c)
784ee2c verified Download The-OpenROAD-Project_OpenROAD-flow-scripts/flow/designs/src/tinyRocket/AsyncResetReg.v from SAIFIINDUSTRIES/verilog_data-1: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/datasets/SAIFIINDUSTRIES/verilog_data-1/resolve/main/The-OpenROAD-Project_OpenROAD-flow-scripts/flow/designs/src/tinyRocket/AsyncResetReg.v
- Command line
-
hf download hf://datasets/SAIFIINDUSTRIES/verilog_data-1/The-OpenROAD-Project_OpenROAD-flow-scripts/flow/designs/src/tinyRocket/AsyncResetReg.v
-
curl -L -o AsyncResetReg.v https://huggingface.co/datasets/SAIFIINDUSTRIES/verilog_data-1/resolve/main/The-OpenROAD-Project_OpenROAD-flow-scripts/flow/designs/src/tinyRocket/AsyncResetReg.v
1.72 kB
| // See LICENSE.SiFive for license details. | |
| /** This black-boxes an Async Reset | |
| * Reg. | |
| * | |
| * Because Chisel doesn't support | |
| * parameterized black boxes, | |
| * we unfortunately have to | |
| * instantiate a number of these. | |
| * | |
| * We also have to hard-code the set/reset. | |
| * | |
| * Do not confuse an asynchronous | |
| * reset signal with an asynchronously | |
| * reset reg. You should still | |
| * properly synchronize your reset | |
| * deassertion. | |
| * | |
| * @param d Data input | |
| * @param q Data Output | |
| * @param clk Clock Input | |
| * @param rst Reset Input | |
| * @param en Write Enable Input | |
| * | |
| */ | |
| module AsyncResetReg (d, q, en, clk, rst); | |
| parameter RESET_VALUE = 0; | |
| input wire d; | |
| output reg q; | |
| input wire en; | |
| input wire clk; | |
| input wire rst; | |
| // There is a lot of initialization | |
| // here you don't normally find in Verilog | |
| // async registers because of scenarios in which reset | |
| // is not actually asserted cleanly at time 0, | |
| // and we want to make sure to properly model | |
| // that, yet Chisel codebase is absolutely intolerant | |
| // of Xs. | |
| initial begin:B0 | |
| integer initvar; | |
| reg [31:0] _RAND; | |
| _RAND = {1{$random}}; | |
| q = _RAND[0]; | |
| // RANDOMIZE | |
| if (rst) begin | |
| q = RESET_VALUE[0]; | |
| end | |
| end | |
| always @(posedge clk or posedge rst) begin | |
| if (rst) begin | |
| q <= RESET_VALUE[0]; | |
| end else if (en) begin | |
| q <= d; | |
| end | |
| end | |
| endmodule // AsyncResetReg | |