Download chips/yosys/tests/sat/counters.v from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 514 Bytes
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/sat/counters.v
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/tests/sat/counters.v
-
curl -L -o counters.v https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/tests/sat/counters.v
514 Bytes
| module counter1(clk, rst, ping); | |
| input clk, rst; | |
| output ping; | |
| reg [31:0] count; | |
| always @(posedge clk) begin | |
| if (rst) | |
| count <= 0; | |
| else | |
| count <= count + 1; | |
| end | |
| assign ping = &count; | |
| endmodule | |
| module counter2(clk, rst, ping); | |
| input clk, rst; | |
| output ping; | |
| reg [31:0] count; | |
| integer i; | |
| reg carry; | |
| always @(posedge clk) begin | |
| carry = 1; | |
| for (i = 0; i < 32; i = i+1) begin | |
| count[i] <= !rst & (count[i] ^ carry); | |
| carry = count[i] & carry; | |
| end | |
| end | |
| assign ping = &count; | |
| endmodule | |