OpenCores
URL https://opencores.org/ocsvn/m1_core/m1_core/trunk

Subversion Repositories m1_core

[/] [m1_core/] [trunk/] [tools/] [bin/] [build_xst] - Blame information for rev 54

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 fafa1971
#!/bin/bash
2
 
3 14 fafa1971
if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
4
if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
5
 
6 2 fafa1971
cd $M1_ROOT/run/synth/xst
7 23 fafa1971
rm -rf *  # Make clean
8 2 fafa1971
 
9 37 fafa1971
# Set variables
10
export DESIGN_TOP="spartan3esk_top"
11
export FPGA_DEVICE="xc3s500e-fg320-4"
12
export CMDFILE="command.xst"
13
export LOGFILE="synth.log"
14 2 fafa1971
 
15 37 fafa1971
# Create command file
16
echo "run" > $CMDFILE
17
echo "-ifn $FILELIST_XST" >> $CMDFILE
18
echo "-ifmt MIXED" >> $CMDFILE
19
echo "-ofn $DESIGN_TOP.ngc" >> $CMDFILE
20
echo "-ofmt NGC" >> $CMDFILE
21
echo "-top $DESIGN_TOP" >> $CMDFILE
22
echo "-opt_mode SPEED" >> $CMDFILE
23
echo "-opt_level 1" >> $CMDFILE
24
echo "-p $FPGA_DEVICE" >> $CMDFILE
25 23 fafa1971
 
26 37 fafa1971
# Run the complete Xilinx flow from synthesis to bitstream
27
xst -ifn $CMDFILE -ofn $LOGFILE
28
ngdbuild -p $FPGA_DEVICE -uc ${M1_ROOT}/hdl/rtl/${DESIGN_TOP}/${DESIGN_TOP}.ucf ${DESIGN_TOP}.ngc 2>&1 | tee --append ${LOGFILE}
29
map -pr b -p $FPGA_DEVICE $DESIGN_TOP 2>&1 | tee --append $LOGFILE
30
par -w -ol high $DESIGN_TOP ${DESIGN_TOP}_par.ncd 2>&1 | tee --append $LOGFILE
31
trce -v 25 ${DESIGN_TOP}_par.ncd ${DESIGN_TOP}.pcf 2>&1 | tee --append $LOGFILE
32
bitgen ${DESIGN_TOP}_par.ncd -l -w ${DESIGN_TOP}.bit 2>&1 | tee --append $LOGFILE
33 23 fafa1971
 
34 37 fafa1971
# Now just use impact to program the device with the bit file... and have fun!!!
35 23 fafa1971
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.