diff --git a/Examples/blink/logic/Makefile b/Examples/blink/logic/Makefile index a3adbe5..2d414ce 100644 --- a/Examples/blink/logic/Makefile +++ b/Examples/blink/logic/Makefile @@ -7,9 +7,18 @@ BGFLAGS = -g TdoPin:PULLNONE -g DonePin:PULLUP \ SIM_CMD = vsim SIM_COMP_SCRIPT = simulation/$(DESIGN)_TB.do SIMGEN_OPTIONS = -p $(FPGA_ARCH) -lang $(LANGUAGE) +IVERILOG = iverilog + SAKC_IP = 192.168.254.101 SRC = $(DESIGN).v + +SIM_SRC = $(DESIGN)_TB.v \ + sim/unisims/BUFG.v \ + sim/unisims/DCM.v \ + sim/unisims/FDDRRSE.v + + all: bits @@ -20,7 +29,7 @@ clean: rm -f *.bit cleanall: clean - rm -rf build simulation/work simulation/transcript simulation/vsim.wlf + rm -rf build simulation/work simulation/transcript simulation/vsim.wlf simulation/blink_TB.vvp simulation/blink_TB.vcd bits: $(DESIGN).bit @@ -65,13 +74,18 @@ $(DESIGN).bit: build/project_r.ncd build/project_r.twr @mv -f build/project_r.bit $@ build/project_r.v: build/project_r.ncd - cd build && netgen -sim -ofmt vhdl project_r.ncd -pcf project.pcf && ngd2ver project.ngd -w project.v + cd build && netgen -sim -ofmt vhdl project_r.ncd -pcf project.pcf && ngd2ver projecsimulationt.ngd -w project.v -sim: +modelsim: cd simulation; $(SIM_CMD) -do $(DESIGN)_TB.do timesim: build/project_r.v cd simulation; $(SIM_CMD) -do $(DESIGN)_TIMING_TB.do +iversim: + $(IVERILOG) -o simulation/$(DESIGN)_TB.vvp $(VINCDIR) $(SRC) $(SIM_SRC) -s $(DESIGN)_TB_v + vvp simulation/$(DESIGN)_TB.vvp; mv $(DESIGN)_TB.vcd simulation/ + gtkwave simulation/$(DESIGN)_TB.vcd& + upload: $(DESIGN).bit scp $(DESIGN).bit root@$(SAKC_IP): diff --git a/Examples/blink/logic/blink_TB.v b/Examples/blink/logic/blink_TB.v index db8dbf8..8284e6e 100644 --- a/Examples/blink/logic/blink_TB.v +++ b/Examples/blink/logic/blink_TB.v @@ -43,8 +43,12 @@ module blink_TB_v; end - initial begin: TEST_CASE + initial begin: TEST_CASE + $dumpfile("blink_TB.vcd"); + $dumpvars(-1, uut); + #10 -> reset_trigger; + #((PERIOD*DUTY_CYCLE)*100) $finish; end endmodule diff --git a/Examples/sram/logic/Makefile b/Examples/sram/logic/Makefile index 056bb8f..147b710 100644 --- a/Examples/sram/logic/Makefile +++ b/Examples/sram/logic/Makefile @@ -8,9 +8,21 @@ SIM_CMD = /opt/cad/modeltech/bin/vsim SIM_COMP_SCRIPT = simulation/$(DESIGN)_TB.do SIMGEN_OPTIONS = -p $(FPGA_ARCH) -lang $(LANGUAGE) SAKC_IP = 192.168.254.101 +IVERILOG = iverilog +XILINXCADROOT = /opt/cad/Xilinx/verilog/src +#XILINXCADROOT = /opt/cad/modeltech/xilinx/verilog/ + SRC = sram_bus.v - + +SIM_SRC = $(DESIGN)_TB.v \ +# sim/unisims/BUFG.v \ +# sim/unisims/DCM.v \ +# sim/unisims/FDDRRSE.v \ +# glbl.v +# sim/unisims/RAMB16_S2_S9.v + + all: bits remake: clean-build all @@ -70,11 +82,17 @@ $(DESIGN).bit: build/project_r.ncd build/project_r.twr build/project_r.v: build/project_r.ncd cd build && netgen -sim -ofmt vhdl project_r.ncd -pcf project.pcf && ngd2ver project.ngd -w project.v -sim: +modelsim: cd simulation; $(SIM_CMD) -do $(DESIGN)_TB.do timesim: build/project_r.v cd simulation; $(SIM_CMD) -do $(DESIGN)_TIMING_TB.do +iversim: + $(IVERILOG) -Wall -y $(XILINXCADROOT)/unisims -y $(XILINXCADROOT)/XilinxCoreLib -o simulation/$(DESIGN)_TB.vvp $(VINCDIR) $(SRC) $(SIM_SRC) -s $(DESIGN)_TB +# $(IVERILOG) -Wall -y $(XILINXCADROOT)/unisims -y $(XILINXCADROOT)/XilinxCoreLib -o simulation/$(DESIGN)_TB.vvp $(VINCDIR) build/project.v $(SIM_SRC) -s $(DESIGN)_TB + vvp simulation/$(DESIGN)_TB.vvp; mv $(DESIGN)_TB.vcd simulation/ + gtkwave simulation/$(DESIGN)_TB.vcd& + upload: $(DESIGN).bit scp $(DESIGN).bit root@$(SAKC_IP): diff --git a/Examples/sram/logic/simulation/sram_bus_TB.do b/Examples/sram/logic/simulation/sram_bus_TB.do index 1c045a7..62fc610 100644 --- a/Examples/sram/logic/simulation/sram_bus_TB.do +++ b/Examples/sram/logic/simulation/sram_bus_TB.do @@ -3,7 +3,7 @@ vlog -incr +libext+.v \ "../sram_bus.v" \ "../sram_bus_TB.v" \ "glbl.v" -vsim -t 1ps -L simprims_ver -L unisims_ver -L xilinxcorelib_ver sram_bus_TB_v glbl +vsim -t 1ps -L simprims_ver -L unisims_ver -L xilinxcorelib_ver sram_bus_TB glbl view wave #do wave.do add wave * diff --git a/Examples/sram/logic/simulation/sram_bus_TIMING_TB.do b/Examples/sram/logic/simulation/sram_bus_TIMING_TB.do index ab6f8a6..93ea9e6 100644 --- a/Examples/sram/logic/simulation/sram_bus_TIMING_TB.do +++ b/Examples/sram/logic/simulation/sram_bus_TIMING_TB.do @@ -1,6 +1,6 @@ vlib work vlog -incr "../build/project.v" "../sram_bus_TB.v" "glbl.v" -vsim -t 1ps -L simprims_ver -L unisims_ver -L xilinxcorelib_ver sram_bus_TB_v glbl +vsim -t 1ps -L simprims_ver -L unisims_ver -L xilinxcorelib_ver sram_bus_TB glbl view wave #do wave.do add wave * diff --git a/Examples/sram/logic/simulation/transcript b/Examples/sram/logic/simulation/transcript index 653e976..ff116ba 100644 --- a/Examples/sram/logic/simulation/transcript +++ b/Examples/sram/logic/simulation/transcript @@ -13,15 +13,15 @@ # Model Technology ModelSim SE vlog 6.0d Compiler 2005.04 Apr 25 2005 # -- Compiling module sram_bus # -- Compiling module glbl -# -- Compiling module sram_bus_TB_v +# -- Compiling module sram_bus_TB # ** Warning: glbl.v(5): 'glbl' already exists. # -- Compiling module glbl # # Top level modules: # glbl -# sram_bus_TB_v -# vsim -L simprims_ver -L unisims_ver -L xilinxcorelib_ver -t 1ps sram_bus_TB_v glbl -# Loading work.sram_bus_TB_v +# sram_bus_TB +# vsim -L simprims_ver -L unisims_ver -L xilinxcorelib_ver -t 1ps sram_bus_TB glbl +# Loading work.sram_bus_TB # Loading work.sram_bus # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_ONE # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_ZERO @@ -33,7 +33,6 @@ # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_BUF # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_LUT3 # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_INV -# Refreshing /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_RAMB16_S2 # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_RAMB16_S2 # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_BPAD # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_IPAD @@ -43,9 +42,9 @@ # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.X_OBUF # Loading work.glbl # ** Warning: (vsim-3017) ../sram_bus_TB.v(21): [TFMPC] - Too few port connections. Expected 8, found 7. -# Region: /sram_bus_TB_v/uut +# Region: /sram_bus_TB/uut # ** Warning: (vsim-3015) ../sram_bus_TB.v(21): [PCDPC] - Port size (8 or 8) does not match connection size (1) for port 'sram_data'. -# Region: /sram_bus_TB_v/uut +# Region: /sram_bus_TB/uut # ** Warning: (vsim-3722) ../sram_bus_TB.v(21): [TFMPC] - Missing connection for port 'led'. # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.ffsrce # Loading /opt/cad/modeltech/xilinx/verilog/simprims_ver.sffsrce @@ -55,9 +54,4 @@ # .main_pane.mdi.interior.cs.vm.paneset.cli_0.wf.clip.cs # .main_pane.workspace # .main_pane.signals.interior.cs - - - - - -exit +quit diff --git a/Examples/sram/logic/simulation/vsim.wlf b/Examples/sram/logic/simulation/vsim.wlf index 231dff4..b88b2ce 100644 Binary files a/Examples/sram/logic/simulation/vsim.wlf and b/Examples/sram/logic/simulation/vsim.wlf differ diff --git a/Examples/sram/logic/simulation/work/_info b/Examples/sram/logic/simulation/work/_info index e107c86..bb1b16f 100644 --- a/Examples/sram/logic/simulation/work/_info +++ b/Examples/sram/logic/simulation/work/_info @@ -12,21 +12,32 @@ OE;L;6.0d;29 r1 31 vsram_bus -IYS7oKaz71LdIhQ>[[g2fo3 +IhWan4YkPClmK5z;GkOZUS2 V7bnNHP1kz?3UaZfjPj4WE1 -w1273511584 +w1273543976 F../build/project.v L0 37 OE;L;6.0d;29 r1 31 -vsram_bus_TB_v -IA=m;kT@