From 7d9fb988443e94507a7d3ca6e0137aaf49af42e1 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Thu, 14 Mar 2013 12:50:17 -0400 Subject: improvements --- Makefile | 11 ++++++++--- README | 6 ++++-- contrib/template.cgp | 12 ++++++++++++ contrib/xilinx.mk | 32 ++++++++++++++++++++------------ project.xise | 30 ++++++++++-------------------- 5 files changed, 54 insertions(+), 37 deletions(-) create mode 100644 contrib/template.cgp diff --git a/Makefile b/Makefile index fb70c09..0fd1347 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,18 @@ vendor = xilinx # This is the chipset from the Xilinx SP605 dev board family = spartan6 -part = xc6slx45t-3-fgg484 +device = xc6slx45t +speedgrade = -3 +device_package = fgg484 +part = $(device)$(speedgrade)-$(device_package) + # is this build host 64 or 32 bits? hostbits = 64 iseenv= /opt/Xilinx/14.3/ISE_DS/ -vfiles = ./hdl/project.v -tbfiles = ./tb/tb.v +vfiles = ./hdl/*.v +tbfiles = ./tb/*.v +xilinx_cores = include ./contrib/xilinx.mk diff --git a/README b/README index cda84b1..f7c9069 100644 --- a/README +++ b/README @@ -17,6 +17,8 @@ lives in: ./hdl/project.v +Add other verilog synthesis (not testbench) files to ./hdl/*.v + To edit the project with the ISE GUI, try: make ise @@ -29,9 +31,9 @@ Simulate with isim via: make simulate -View the results using isim with: +View the results using the isim GUI with: - make isim_gui + make isim In isim, you can open the "signals.wcfg" in the file menu to reload a the logic analyzer configuration. This cfg file will not be valid if you delete any diff --git a/contrib/template.cgp b/contrib/template.cgp new file mode 100644 index 0000000..d5ac466 --- /dev/null +++ b/contrib/template.cgp @@ -0,0 +1,12 @@ +SET addpads = false +SET asysymbol = true +SET busformat = BusFormatAngleBracketNotRipped +SET createndf = false +SET flowvendor = Other +SET formalverification = false +SET foundationsym = false +SET implementationfiletype = Ngc +SET removerpms = false +SET simulationfiles = Behavioral +SET verilogsim = true +SET vhdlsim = false diff --git a/contrib/xilinx.mk b/contrib/xilinx.mk index f8773ac..7060c99 100644 --- a/contrib/xilinx.mk +++ b/contrib/xilinx.mk @@ -45,7 +45,7 @@ par_opts ?= -ol high hostbits = 64 iseenv= /opt/Xilinx/14.3/ISE_DS iseenvfile?= $(iseenv)/settings$(hostbits).sh -xil_env ?= cd ./build; source $(iseenvfile) > /dev/null +xil_env ?= mkdir -p build/; cd ./build; source $(iseenvfile) > /dev/null sim_env ?= cd ./tb; source $(iseenvfile) > /dev/null flashsize ?= 8192 @@ -70,25 +70,32 @@ $(2): $(1) endef $(foreach ngc,$(corengcs),$(eval $(call cp_template,$(ngc),$(notdir $(ngc))))) -%.ngc %.v: %.xco - @echo "=== rebuilding $@" +$(coregen_work_dir)/$(project).cgp: contrib/template.cgp Makefile if [ -d $(coregen_work_dir) ]; then \ rm -rf $(coregen_work_dir)/*; \ else \ mkdir -p $(coregen_work_dir); \ fi - cd $(coregen_work_dir); \ - bash -c "$(xil_env); \ - coregen -b $$OLDPWD/$<; \ - cd - + cp contrib/template.cgp $@ + echo "SET designentry = Verilog " >> $@ + echo "SET device = $(device)" >> $@ + echo "SET devicefamily = $(family)" >> $@ + echo "SET package = $(device_package)" >> $@ + echo "SET speedgrade = $(speedgrade)" >> $@ + echo "SET workingdirectory = ./tmp/" >> $@ + +%.ngc %.v: %.xco $(coregen_work_dir)/$(project).cgp + @echo "=== rebuilding $@" + bash -c "$(xil_env); cd ../$(coregen_work_dir); coregen -b $$OLDPWD/../$< -p $(project).cgp;" xcodir=`dirname $<`; \ basename=`basename $< .xco`; \ - if [ ! -r $(coregen_work_dir/$$basename.ngc) ]; then \ + echo $(coregen_work_dir)/$$basename.v; \ + if [ ! -r $(coregen_work_dir)/$$basename.ngc ]; then \ echo "'$@' wasn't created."; \ exit 1; \ else \ cp $(coregen_work_dir)/$$basename.v $(coregen_work_dir)/$$basename.ngc $$xcodir; \ - fi" + fi junk += $(coregen_work_dir) date = $(shell date +%F-%H-%M) @@ -140,7 +147,7 @@ junk += $(project)_summary.xml $(project)_usage.xml build/$(project).ngd: build/$(project).ngc $(project).ucf $(project).bmm bash -c "$(xil_env); \ - ngdbuild $(intstyle) $(project).ngc -bm ../$(project).bmm" + ngdbuild $(intstyle) $(project).ngc -bm ../$(project).bmm -sd ../cores" junk += $(project).ngd $(project).bld build/$(project).ngc: $(vfiles) $(local_corengcs) build/$(project).scr build/$(project).prj @@ -202,10 +209,10 @@ tb/simulate_isim: tb/isim simulate: tb/simulate_isim -isim_gui: simulate +isim_cli: simulate bash -c "$(sim_env); cd ../tb/; ./simulate_isim" -isim_gui: simulate +isim: simulate bash -c "$(sim_env); cd ../tb/; ./simulate_isim -gui -view signals.wcfg" ise: @@ -224,5 +231,6 @@ clean_sim:: clean_synth:: rm -rf build + rm -rf coregen-tmp #rm -rf $(junk) diff --git a/project.xise b/project.xise index cff885d..42b5b99 100644 --- a/project.xise +++ b/project.xise @@ -14,18 +14,7 @@ - - - - - - - - - - - - + @@ -88,6 +77,7 @@ + @@ -140,9 +130,9 @@ - + - + @@ -205,11 +195,11 @@ - + - + @@ -219,10 +209,10 @@ - - - - + + + + -- cgit v1.2.3