spartan3e: init
[hwmod.git] / spartan3e / Makefile
diff --git a/spartan3e/Makefile b/spartan3e/Makefile
new file mode 100644 (file)
index 0000000..9a8725c
--- /dev/null
@@ -0,0 +1,97 @@
+SHELL := bash
+
+VHDL_DIR := ../src
+PROJ_VHDL = alu.vhd \
+       textmode_vga/spartan3e_starterkit/textmode_vga_platform_dependent_pkg.vhd \
+       calc_s3e.vhd \
+       dcm_s3e.vhd \
+       display.vhd \
+       history.vhd \
+       math_pkg.vhd \
+       gen_pkg.vhd \
+       parser.vhd \
+       scanner.vhd \
+       sp_ram.vhd \
+       textmode_vga/console_sm.vhd \
+       textmode_vga/console_sm_beh.vhd \
+       textmode_vga/console_sm_sync.vhd \
+       textmode_vga/console_sm_sync_beh.vhd \
+       textmode_vga/font_pkg.vhd \
+       textmode_vga/font_rom.vhd \
+       textmode_vga/font_rom_beh.vhd \
+       textmode_vga/interval.vhd \
+       textmode_vga/interval_beh.vhd \
+       textmode_vga/textmode_vga.vhd \
+       textmode_vga/textmode_vga_component_pkg.vhd \
+       textmode_vga/textmode_vga_h_sm.vhd \
+       textmode_vga/textmode_vga_h_sm_beh.vhd \
+       textmode_vga/textmode_vga_pkg.vhd \
+       textmode_vga/textmode_vga_struct.vhd \
+       textmode_vga/textmode_vga_v_sm.vhd \
+       textmode_vga/textmode_vga_v_sm_beh.vhd \
+       textmode_vga/video_memory.vhd \
+       textmode_vga/video_memory_beh.vhd \
+       ps2/ps2_keyboard_controller.vhd \
+       ps2/ps2_keyboard_controller_beh.vhd \
+       ps2/ps2_keyboard_controller_pkg.vhd \
+       ps2/ps2_transceiver.vhd \
+       ps2/ps2_transceiver_beh.vhd \
+       ps2/ps2_transceiver_pkg.vhd
+
+PROJ_VHDL := $(foreach n,$(PROJ_VHDL),$(VHDL_DIR)/$(n))
+
+NAME := calc
+
+
+all: generated/$(NAME).mcs
+
+generated: 
+       rm -rf generated
+       mkdir generated
+
+clean:
+       rm -rf *.o *.cf tb *.vcd $(NAME) $(SIM_TOP) *.ghw
+       rm -f *.bit *.bgn *_pad.txt *_pad.csv *.xpi *.srp *.ngc *.par
+       rm -f *.lst *.ngd *.ngm *.pcf *.mrp *.unroutes *.pad
+       rm -f *.bld *.ncd *.twr *.drc
+       rm -f *.map *.xrpt *.log *.twx *.xml *.ptwx
+       rm -rf xst $(NAME).prj
+       rm -rf generated/
+       rm -rf xlnx_auto_0_xdb
+
+#Xilinx ISE actions. Uses a wrapper script named "xilinx" to run the ISE batch commands
+
+# create an ISE project file from the list of VHDL files
+$(NAME).prj: $(PROJ_VHDL)
+       echo $(PROJ_VHDL) |tr " " "\n">$(NAME).prj
+
+bitfile: generated step0 step1 step2 step3 step4 step5
+
+step0: $(NAME).prj 
+       xst -ifn ISE_scripts/$(NAME).scrs -ofn $(NAME).srp
+step1:
+       ngdbuild -nt on -uc spartan3e.ucf $(NAME).ngc $(NAME).ngd
+step2:
+       map -pr b $(NAME).ngd -o $(NAME).ncd $(NAME).pcf
+step3:
+       par -w -ol high $(NAME).ncd $(NAME).ncd $(NAME).pcf
+step4:
+       trce -v 10 -o $(NAME).twr $(NAME).ncd $(NAME).pcf
+step5:
+       bitgen $(NAME).ncd generated/$(NAME).bit -w #-f $(NAME).ut
+
+generated/$(NAME).bit: bitfile
+
+mcs: generated/$(NAME).bit
+       impact -batch ISE_scripts/makeprom.cmds
+
+generated/$(NAME).mcs: mcs
+
+load: generated/$(NAME).mcs
+       impact -batch ISE_scripts/loadprom.cmds
+
+impact:
+       impact
+
+ise: $(NAME).prj
+       ise