Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jona250210 committed Jan 25, 2024
1 parent f9f79ac commit f2dc45a
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 4 deletions.
7 changes: 3 additions & 4 deletions info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ project:

# If using an HDL, set wokwi_id as 0 and uncomment and list your source files here.
# Source files must be in ./src and you must list each source file separately
# source_files:
# - counter.v
# - decoder.v
# top_module: "tt_um_example" # Put the name of your top module here, must start with "tt_um_". Make it unique by including your github username
source_files:
- tt_um_nand.sv
top_module: "tt_um_nand" # Put the name of your top module here, must start with "tt_um_". Make it unique by including your github username

# How many tiles your design occupies? A single tile is about 167x108 uM.
tiles: "1x1" # Valid values: 1x1, 1x2, 2x2, 3x2, 4x2 or 8x2
Expand Down
41 changes: 41 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Makefile
# See https://docs.cocotb.org/en/stable/quickstart.html for more info

.PHONY: simulate convert all

# defaults
SIM ?= icarus
TOPLEVEL_LANG ?= verilog

# normal simulation
ifneq ($(GATES),yes)

# this is the only part you should need to modify:
VERILOG_SOURCES += $(PWD)/tt_um_nand.sv

else

# gate level simulation requires some extra setup, you shouldn't need to touch this
COMPILE_ARGS += -DGL_TEST
COMPILE_ARGS += -DFUNCTIONAL
COMPILE_ARGS += -DUSE_POWER_PINS
COMPILE_ARGS += -DSIM
COMPILE_ARGS += -DUNIT_DELAY=\#1
VERILOG_SOURCES += $(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/verilog/primitives.v
VERILOG_SOURCES += $(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v

# this gets copied in by the GDS action workflow
VERILOG_SOURCES += $(PWD)/tb.v $(PWD)/gate_level_netlist.v
endif

# TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file
TOPLEVEL = tb

# MODULE is the basename of the Python test file
MODULE = test

# include cocotb's make rules to take care of the simulator setup
include $(shell cocotb-config --makefiles)/Makefile.sim

convert: $(FILE).sv
yosys "-p read_verilog -sv $(FILE).sv; write_verilog $(FILE).v"
29 changes: 29 additions & 0 deletions src/tt_um_nand.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//==============================================================================
//
// The code is generated by Intel Compiler for SystemC, version 1.5.15
// see more information at https://github.com/intel/systemc-compiler
//
//==============================================================================

//==============================================================================
//
// Module: nand_gate ()
//
module tt_um_nand // "tb.dut_inst"
(
input logic A,
input logic B,
output logic Z
);

//------------------------------------------------------------------------------
// Method process: do_nand (nand_gate.h:11:5)

always_comb
begin : do_nand // nand_gate.h:11:5
Z = !(A && B);
end

endmodule


0 comments on commit f2dc45a

Please sign in to comment.