2010-05-01 06:21:55 +03:00
|
|
|
DESIGN = plasma
|
2010-04-22 04:01:38 +03:00
|
|
|
PINS = $(DESIGN).ucf
|
|
|
|
DEVICE = xc3s500e-fg320-4
|
|
|
|
BGFLAGS = -g TdoPin:PULLNONE -g DonePin:PULLUP \
|
|
|
|
-g CRC:enable -g StartUpClk:CCLK
|
|
|
|
SIM_CMD = /opt/cad/modeltech/bin/vsim
|
|
|
|
SIM_COMP_SCRIPT = simulation/$(DESIGN)_TB.do
|
|
|
|
SIMGEN_OPTIONS = -p $(FPGA_ARCH) -lang $(LANGUAGE)
|
|
|
|
|
2010-05-04 19:17:38 +03:00
|
|
|
SRC_HDL = plasma.vhd alu.vhd control.vhd mem_ctrl.vhd mult.vhd shifter.vhd bus_mux.vhd ddr_ctrl.vhd mlite_cpu.vhd pc_next.vhd cache.vhd eth_dma.vhd mlite_pack.vhd pipeline.vhd reg_bank.vhd uart.vhd ram_image.vhd
|
2010-04-22 04:01:38 +03:00
|
|
|
|
|
|
|
all: bits
|
|
|
|
|
|
|
|
remake: clean-build all
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf *~ */*~ a.out *.log *.key *.edf *.ps trace.dat
|
|
|
|
rm -rf *.bit rm -rf simulation/work simulation/*wlf
|
2010-05-01 06:21:55 +03:00
|
|
|
rm -rf simulation/transcript
|
2010-04-22 04:01:38 +03:00
|
|
|
|
|
|
|
clean-build:
|
|
|
|
rm -rf build
|
|
|
|
|
|
|
|
cleanall: clean
|
|
|
|
rm -rf build work $(DESIGN).bit
|
|
|
|
|
|
|
|
bits: $(DESIGN).bit
|
|
|
|
|
|
|
|
#
|
|
|
|
# Synthesis
|
|
|
|
#
|
|
|
|
build/project.src:
|
|
|
|
@[ -d build ] || mkdir build
|
|
|
|
@rm -f $@
|
|
|
|
for i in $(SRC); do echo verilog work ../$$i >> $@; done
|
|
|
|
for i in $(SRC_HDL); do echo VHDL work ../$$i >> $@; done
|
|
|
|
|
|
|
|
build/project.xst: build/project.src
|
|
|
|
echo "run" > $@
|
|
|
|
echo "-top $(DESIGN) " >> $@
|
|
|
|
echo "-p $(DEVICE)" >> $@
|
|
|
|
echo "-opt_mode Area" >> $@
|
|
|
|
echo "-opt_level 1" >> $@
|
|
|
|
echo "-ifn project.src" >> $@
|
|
|
|
echo "-ifmt mixed" >> $@
|
|
|
|
echo "-ofn project.ngc" >> $@
|
|
|
|
echo "-ofmt NGC" >> $@
|
|
|
|
echo "-rtlview yes" >> $@
|
|
|
|
|
|
|
|
build/project.ngc: build/project.xst $(SRC)
|
|
|
|
cd build && xst -ifn project.xst -ofn project.log
|
|
|
|
|
2010-05-04 19:17:38 +03:00
|
|
|
build/project.ngd: build/project.ngc #$(PINS)
|
|
|
|
cd build && ngdbuild -p $(DEVICE) project.ngc #-uc ../$(PINS)
|
2010-04-22 04:01:38 +03:00
|
|
|
|
|
|
|
build/project.ncd: build/project.ngd
|
|
|
|
cd build && map -pr b -p $(DEVICE) project
|
|
|
|
|
|
|
|
build/project_r.ncd: build/project.ncd
|
|
|
|
cd build && par -w project project_r.ncd
|
|
|
|
|
|
|
|
build/project_r.twr: build/project_r.ncd
|
|
|
|
cd build && trce -v 25 project_r.ncd project.pcf
|
|
|
|
|
|
|
|
$(DESIGN).bit: build/project_r.ncd build/project_r.twr
|
|
|
|
cd build && bitgen project_r.ncd -l -w $(BGFLAGS)
|
|
|
|
@mv -f build/project_r.bit $@
|
2010-05-10 22:56:51 +03:00
|
|
|
|
|
|
|
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:
|
|
|
|
cd simulation; $(SIM_CMD) -do $(DESIGN)_TB.do
|
|
|
|
|
|
|
|
timesim: build/project_r.v
|
|
|
|
cd simulation; $(SIM_CMD) -do $(DESIGN)_TIMING_TB.do
|
2010-04-22 04:01:38 +03:00
|
|
|
|
|
|
|
sim:
|
|
|
|
cd simulation; $(SIM_CMD) -do $(DESIGN)_TB.do
|
|
|
|
|