This repository has been archived by the owner on Nov 10, 2024. It is now read-only.
forked from TinyTapeout/tt09-verilog-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
133 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
/* | ||
This file provides the mapping from the Wokwi modules to Verilog HDL. | ||
It's only needed for Wokwi designs. | ||
*/ | ||
|
||
`define default_netname none | ||
|
||
module buffer_cell ( | ||
input wire in, | ||
output wire out | ||
); | ||
assign out = in; | ||
endmodule | ||
|
||
module and_cell ( | ||
input wire a, | ||
input wire b, | ||
output wire out | ||
); | ||
|
||
assign out = a & b; | ||
endmodule | ||
|
||
module or_cell ( | ||
input wire a, | ||
input wire b, | ||
output wire out | ||
); | ||
|
||
assign out = a | b; | ||
endmodule | ||
|
||
module xor_cell ( | ||
input wire a, | ||
input wire b, | ||
output wire out | ||
); | ||
|
||
assign out = a ^ b; | ||
endmodule | ||
|
||
module nand_cell ( | ||
input wire a, | ||
input wire b, | ||
output wire out | ||
); | ||
|
||
assign out = !(a&b); | ||
endmodule | ||
|
||
module not_cell ( | ||
input wire in, | ||
output wire out | ||
); | ||
|
||
assign out = !in; | ||
endmodule | ||
|
||
module mux_cell ( | ||
input wire a, | ||
input wire b, | ||
input wire sel, | ||
output wire out | ||
); | ||
|
||
assign out = sel ? b : a; | ||
endmodule | ||
|
||
module dff_cell ( | ||
input wire clk, | ||
input wire d, | ||
output reg q, | ||
output wire notq | ||
); | ||
|
||
assign notq = !q; | ||
always @(posedge clk) | ||
q <= d; | ||
|
||
endmodule | ||
|
||
module dffsr_cell ( | ||
input wire clk, | ||
input wire d, | ||
input wire s, | ||
input wire r, | ||
output reg q, | ||
output wire notq | ||
); | ||
|
||
assign notq = !q; | ||
|
||
always @(posedge clk or posedge s or posedge r) begin | ||
if (r) | ||
q <= 0; | ||
else if (s) | ||
q <= 1; | ||
else | ||
q <= d; | ||
end | ||
endmodule |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.