URL
https://opencores.org/ocsvn/minsoc/minsoc/trunk
Subversion Repositories minsoc
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 172 to Rev 171
- ↔ Reverse comparison
Rev 172 → Rev 171
/minsoc/tags/release-1.0/utils/setup/minsoc-prepare.sh
0,0 → 1,251
#!/bin/bash |
|
# This script sets-up an initial environment for minsoc development |
# Written by Javier Almansa Sobrino <javier.almansa@efsystems.net> |
|
SYN_DIR=$MINSOC_DIR/syn |
SYNSUPPORT_DIR=$SYN_DIR/buildSupport |
FIND_PART='DEVICE_PART' |
FIND_FAMILY='FAMILY_PART' |
FIND_VERSION='SW_VERSION' |
FIND_CONSTRAINT='CONSTRAINT_FILE' |
HOME_DIR=`pwd` |
MAKE_PATTERN=make.generic |
|
dialog --no-cancel --title "Select device part" \ |
--inputbox "Select device" 7 50 "EP3C25Q240C8" 2> /tmp/device.$$ |
|
case $? in |
255) echo "Device not selected. Aborting...\n"; exit 1 ;; |
0) DEVICE_PART=`cat /tmp/device.$$`;; |
esac |
|
dialog --no-cancel --title "Select device vendor" \ |
--radiolist "Select FPGA vendor" 10 50 5 1 "Altera" on 2 "Xilinx" off 2> /tmp/vendor.$$ |
|
if [ $? -eq 255 ]; then |
echo "Device vendor not selected. Aborting...\n" |
exit 1 |
fi |
|
case `cat /tmp/vendor.$$` in |
1) SYNSRC_DIR=$MINSOC_DIR/prj/altera; \ |
MAKEFILE_DIR=$SYN_DIR/altera; \ |
PROJECT_FILE=minsoc_top.qsf; \ |
VENDOR="Altera" \ |
SYN_FILES=(adbg_top.vprj jtag_top.vprj or1200_top.vprj uart_top.vprj \ |
minsoc_top.vprj altera_virtual_jtag.vhdprj) ;; |
2) SYNSRC_DIR=$MINSOC_DIR/prj/xilinx; \ |
MAKEFILE_DIR=$SYN_DIR/xilinx; \ |
VENDOR="Xilinx" \ |
SYN_FILES= ;; |
esac |
|
case `cat /tmp/vendor.$$` in |
1) dialog --no-cancel --title "Select Altera device family" \ |
--radiolist "Select Altera device family" 15 50 10 \ |
1 "Arria II GX" off \ |
2 "Cyclone II" off \ |
3 "Cyclone III" on \ |
4 "Cyclone III LS" off \ |
5 "Cyclone IV E" off \ |
6 "Cyclone IV GX" off \ |
7 "Cyclone V (E/GX/GT/SX/SE/ST)" off \ |
2> /tmp/family.$$ ;; |
2) echo "Families for Xilinx devices not configured. Aborting..."; exit 1 ;; |
esac |
|
FAMILY=`cat /tmp/family.$$` |
case `cat /tmp/family.$$` in |
1) FAMILY_PART="Arria II GX" ;; |
2) FAMILY_PART="Cyclone II" ;; |
3) FAMILY_PART="Cyclone III" ;; |
4) FAMILY_PART="Cyclone III LS" ;; |
5) FAMILY_PART="Cyclone IV E" ;; |
6) FAMILY_PART="Cyclone IV GX" ;; |
7) FAMILY_PART="Cyclone V (E/GX/GT/SX/SE/ST)" ;; |
esac |
|
dialog --no-cancel --title "Select user Verilog path list" \ |
--inputbox "Select user Verilog path list" 7 50 "verilog.path" 2> /tmp/vpath.$$ |
|
case $? in |
0) if [ `cat /tmp/vpath.$$ | wc -c` = "0" ]; then |
VERILOG_PATH=" " |
else |
VERILOG_PATH=`cat /tmp/vpath.$$` |
fi ;; |
255) VERILOG_PATH=" " ;; |
esac |
|
dialog --no-cancel --title "Select user VHDL path list" \ |
--inputbox "Select user VHDL path list" 7 50 "vhdl.path" 2> /tmp/vhdpath.$$ |
|
case $? in |
0) if [ `cat /tmp/vhdpath.$$ | wc -c` = "0" ]; then |
VHDL_PATH=" " |
else |
VHDL_PATH=`cat /tmp/vhdpath.$$` |
fi ;; |
255) VHDL_PATH=" " ;; |
esac |
|
if [ $VENDOR = "Altera" ]; then |
|
dialog --no-cancel --title "Select user UCF File" \ |
--inputbox "Select user UCF File" 7 50 "user.ucf" 2> /tmp/ucf.$$ |
|
case $? in |
0) if [ `cat /tmp/ucf.$$ | wc -c` = "0" ]; then |
echo "Error: You must privide an UCF file"; exit 1; |
else |
UCF_FILE=`cat /tmp/ucf.$$` |
fi ;; |
255) echo "Error: You must privide an UCF file"; exit 1;; |
esac |
|
DEFINES_FILE=minsoc_defines.v |
MINSOC_TOP_FILE=minsoc_top.v |
VERILOG_USER_FILES=$HOME_DIR/verilog |
VHDL_USER_FILES=$HOME_DIR/vhdl |
VERILOG_PRJ_FILE=user.vprj |
VHDL_PRJ_FILE=user.vhdprj |
|
command -v quartus >/dev/null 2>&1 || { echo >&2 "Altera synthesis requires Quartus software but it's not installed. Aborting..."; exit 1; } |
|
reset |
|
echo "Minsoc configuration report:" |
echo -n "Device Vendor: " |
echo $VENDOR |
echo -n "Device Family: " |
echo $FAMILY_PART |
echo -n "Device Part: " |
echo $DEVICE_PART |
echo -n "Minsoc Home: " |
echo $MINSOC_DIR |
echo -n "Minsoc output dir: " |
echo $HOME_DIR |
echo -n "UCF File: " |
echo $UCF_FILE |
|
if [ ! $VERILOG_PATH == " " ] |
then |
for filedir in `cat $VERILOG_PATH` |
do |
echo -n "User Verilog path: " |
echo $filedir |
done |
fi |
|
if [ ! $VHDL_PATH == " " ] |
then |
for filedir in `cat $VHDL_PATH` |
do |
echo -n "User VHDL path: " |
echo $filedir |
done |
fi |
echo |
echo "Press [ENTER] to start Minsoc base deploying" |
read |
echo "Starting..." |
echo "Generating project files for simulation and synthesis..." |
echo "__________________________________________________________________________" |
echo "" |
make -C $MINSOC_DIR/prj |
echo "Generation complete." |
echo "" |
echo "__________________________________________________________________________" |
echo |
echo "Device part and family for files under $SYNSRC_DIR will patched and stored " |
echo "temporarily." |
echo "Afterwards, they are copied to $HOME_DIR." |
echo "__________________________________________________________________________" |
echo "" |
sed "s/$FIND_PART/$DEVICE_PART/g" $MAKEFILE_DIR/$PROJECT_FILE > /tmp/TMPFILE.$$ |
sed "s/$FIND_FAMILY/$FAMILY_PART/g" /tmp/TMPFILE.$$ > $HOME_DIR/$PROJECT_FILE |
|
echo "Generating quartus settings from prj files in $SYNSRC_DIR" |
for file in "${SYN_FILES[@]}" |
do |
echo "Adding settings from file $file..." |
cat $SYNSRC_DIR/$file | grep -v "minsoc_defines" | grep -v minsoc_top >> $HOME_DIR/$PROJECT_FILE |
done |
|
echo "set_global_assignment -name SEARCH_PATH" $HOME_DIR >> $HOME_DIR/$PROJECT_FILE |
echo "set_global_assignment -name VERILOG_FILE" $HOME_DIR/$DEFINES_FILE >> $HOME_DIR/$PROJECT_FILE |
echo "set_global_assignment -name VERILOG_FILE" $HOME_DIR/$MINSOC_TOP_FILE >> $HOME_DIR/$PROJECT_FILE |
|
if [ ! $VERILOG_PATH == " " ] |
then |
echo "Adding user Verilog files to project" |
for filedir in `cat $VERILOG_PATH` |
do |
echo "set_global_assignment -name SEARCH_PATH" $filedir >> $HOME_DIR/$PROJECT_FILE |
for file in `ls -C $filedir/*.v` |
do |
echo "set_global_assignment -name VERILOG_FILE" $file >> $HOME_DIR/$PROJECT_FILE |
echo "Adding" $file "to project" |
done |
done |
fi |
|
if [ ! $VHDL_PATH == " " ] |
then |
echo "Adding user Verilog files to project" |
for filedir in `cat $VHDL_PATH` |
do |
echo "set_global_assignment -name SEARCH_PATH" $filedir >> $HOME_DIR/$PROJECT_FILE |
for file in `ls -C $filedir/*.vhdl` |
do |
echo "set_global_assignment -name VHDL_FILE" $file >> $HOME_DIR/$PROJECT_FILE |
echo "Adding" $file "to project" |
done |
done |
fi |
echo "Adding user constraints from" $UCF_FILE |
cat $UCF_FILE >> $HOME_DIR/$PROJECT_FILE |
|
ls $HOME_DIR/$DEFINES_FILE 2> /dev/null > /dev/null |
if [ $? -eq 0 ] |
then |
echo "$HOME_DIR/$DEFINES_FILE exists. Skipping ..." |
else |
cp $MINSOC_DIR/backend/altera_3c25_board/$DEFINES_FILE $HOME_DIR |
echo "Created" $DEFINES_FILE "file in" $HOME_DIR |
fi; |
|
ls $HOME_DIR/$MINSOC_TOP_FILE 2> /dev/null > /dev/null |
if [ $? -eq 0 ] |
then |
echo "$HOME_DIR/$MINSOC_TOP_FILE exists. Skipping ..." |
else |
cp $MINSOC_DIR/rtl/verilog/minsoc_top.v $HOME_DIR |
echo "Created" $MINSOC_TOP_FILE "file in" $HOME_DIR |
fi; |
|
ls $HOME_DIR/Makefile 2> /dev/null > /dev/null |
if [ $? -eq 0 ] |
then |
echo "$HOME_DIR/Makefile exists. Skipping ..." |
else |
cp $MAKEFILE_DIR/$MAKE_PATTERN $HOME_DIR/Makefile |
echo "Created Makefile in" $HOME_DIR |
fi; |
|
echo "" |
echo "" |
echo "MinSoC is ready to be synthetized. If you need, you can tune-up" |
echo "your project before by editing" $HOME_DIR/$PROJECT_FILE "for add or delete" |
echo "your own VHDL or Verilog modules." |
echo "If you have added your own Whisbone compatible modules to your project, you" |
echo "will need to tune-up" $HOME_DIR/$MINSOC_TOP_FILE "to connecto your modules" |
echo "to the rest of the system." |
echo $HOME_DIR/$DEFINES_FILE "contains definitions for configuring default components". |
echo "" |
echo "For synthetize help, type 'make'" |
|
fi # IF ALTERA |
|
|
minsoc/tags/release-1.0/utils/setup/minsoc-prepare.sh
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: minsoc/tags/release-1.0/utils/setup/minsoc-install.sh
===================================================================
--- minsoc/tags/release-1.0/utils/setup/minsoc-install.sh (revision 172)
+++ minsoc/tags/release-1.0/utils/setup/minsoc-install.sh (revision 171)
@@ -101,7 +101,7 @@
execcmd "Creating directory ./download for downloaded packages" "mkdir -p download"
execcmd "Creating directory ./tools for package binaries" "mkdir -p tools"
-
+#FIXME we should create an archive file of all the dependencies use a single wget
#Downloading everything we need
cecho "\nDownloading packages"
cd ${DIR_TO_INSTALL}
@@ -110,25 +110,25 @@
execcmd "cd ${DIR_TO_INSTALL}/download"
if [ "$ENV" == "Cygwin" ]
then
- execcmd "Downloading GNU Toolchain" "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-elf-cygwin-1.7.tar.bz2";
+ execcmd "Downloading GNU Toolchain" "wget http://minsoc.com/dep/v.1.0/or32-elf-cygwin-1.7.tar.bz2";
else
if [ $KERNEL_ARCH == "32" ];
then
- execcmd "Downloading GNU Toolchain" "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-elf-linux-x86.tar.bz2";
+ execcmd "Downloading GNU Toolchain" "wget http://minsoc.com/dep/v.1.0/or32-elf-linux-x86.tar.bz2";
elif [ $KERNEL_ARCH == "64" ];
then
- execcmd "Downloading GNU Toolchain" "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-elf-linux-x86_64.tar.bz2";
+ execcmd "Downloading GNU Toolchain" "wget http://minsoc.com/dep/v.1.0/or32-elf-linux-x86_64.tar.bz2";
fi
fi
-execcmd "Downloading GDB" "wget ftp://anonymous:anonymous@ftp.gnu.org/gnu/gdb/gdb-6.8a.tar.bz2"
-execcmd "wget ftp://ocuser:ocuser@openrisc.opencores.org/toolchain/or32-gdb-6.8-patch-2.4.bz2"
-execcmd "svn export -q http://opencores.org/ocsvn/adv_debug_sys/adv_debug_sys/trunk/Patches/GDB6.8/gdb-6.8-bz436037-reg-no-longer-active.patch"
+execcmd "Downloading GDB" "wget http://minsoc.com/dep/v.1.0/gdb-6.8a.tar.bz2"
+execcmd "wget http://minsoc.com/dep/v.1.0/or32-gdb-6.8-patch-2.4.bz2"
+execcmd "wget http://minsoc.com/dep/v.1.0/gdb-6.8-bz436037-reg-no-longer-active.patch"
if [ "$ENV" != "Cygwin" ]
then
- execcmd "Downloading libusb-0.1 for Advanced Debug System" "wget http://sourceforge.net/projects/libusb/files/libusb-0.1%20%28LEGACY%29/0.1.12/libusb-0.1.12.tar.gz"
+ execcmd "Downloading libusb-0.1 for Advanced Debug System" "wget http://minsoc.com/dep/v.1.0/libusb-0.1.12.tar.gz"
fi
-execcmd "Downloading libftdi for Advanced Debug System" "wget http://www.intra2net.com/en/developer/libftdi/download/libftdi-0.19.tar.gz"
-execcmd "Downloading Icarus Verilog" "wget ftp://icarus.com/pub/eda/verilog/v0.9/verilog-0.9.4.tar.gz"
+execcmd "Downloading libftdi for Advanced Debug System" "wget http://minsoc.com/dep/v.1.0/libftdi-0.19.tar.gz"
+execcmd "Downloading Icarus Verilog" "wget http://minsoc.com/dep/v.1.0/verilog-0.9.4.tar.gz"
#Uncompressing everything
/minsoc/tags/release-1.0/syn/altera/make.generic
0,0 → 1,46
QSF_FILE = minsoc_top |
help: |
@echo " all: Synthesize and implement the SoC, then generate a bit stream" |
@echo "" |
@echo " bitgen: Generate a programming file for the target FPGA" |
@echo " map: Express the SoC netlist in the target hardware" |
@echo " fit: Place the target hardware, then route the wires" |
@echo " sta: Perfom a timming analysis" |
@echo " eda: Generate a netlist of the hardware" |
@echo " config: Load the bitstream into the device using ALTERA USB Blaster and JTAG configuration" |
@echo "" |
@echo " clean: Delete all superfluous files generated by Altera tools" |
@echo " distclean: Delete all generated files" |
|
all: bitgen eda sta |
map: minsoc_top.map.summary |
fit: minsoc_top.fit.summary |
bitgen: minsoc_top.sof |
eda: minsoc_top.eda.summary |
sta: minsoc_top.sta.summary |
|
minsoc_top.map.summary: minsoc_defines.v minsoc_top.qsf |
quartus_map $(QSF_FILE) --write_settings_files=off |
|
minsoc_top.fit.summary: minsoc_top.map.summary |
quartus_fit $(QSF_FILE) --write_Settings_files=off --pack_register=minimize_area |
|
minsoc_top.sof: minsoc_top.fit.summary |
quartus_asm $(QSF_FILE) |
|
minsoc_top.sta.summary: minsoc_top.fit.summary |
quartus_sta $(QSF_FILE) |
|
minsoc_top.eda.summary: minsoc_top.fit.summary |
quartus_eda $(QSF_FILE) --write_settings_files=off |
|
config: minsoc_top.sof |
quartus_pgm -c USB-Blaster -m jtag -o "p;minsoc_top.sof" |
|
distclean: |
$(RM) *.sof |
make clean |
|
clean: |
$(RM) *.rpt *.summary *.jdi *.smsg *.pin *.qpf |
$(RM) -r db incremental_db |