URL
https://opencores.org/ocsvn/m1_core/m1_core/trunk
Subversion Repositories m1_core
Compare Revisions
- This comparison shows the changes necessary to convert path
/m1_core/trunk/tools/bin
- from Rev 41 to Rev 54
- ↔ Reverse comparison
Rev 41 → Rev 54
/make_clean
0,0 → 1,15
#!/bin/bash |
|
if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi |
if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi |
|
rm -rf $M1_ROOT/run |
mkdir $M1_ROOT/run |
mkdir $M1_ROOT/run/sim |
mkdir $M1_ROOT/run/sim/icarus |
mkdir $M1_ROOT/run/synth |
mkdir $M1_ROOT/run/synth/dc |
mkdir $M1_ROOT/run/synth/xst |
|
find $M1_ROOT -name "*~" -exec rm {} \; |
|
make_clean
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: dump2vlog.php
===================================================================
--- dump2vlog.php (nonexistent)
+++ dump2vlog.php (revision 54)
@@ -0,0 +1,33 @@
+#!/usr/bin/php -q
+
\ No newline at end of file
dump2vlog.php
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: build_dc
===================================================================
--- build_dc (nonexistent)
+++ build_dc (revision 54)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
+if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
+
+cd $M1_ROOT/run/synth/dc
+rm -rf * .syn* # Make clean
+
+# Create setup file
+export SETUP_FILE=".synopsys_dc.setup"
+echo "set search_path [concat [list ~] $search_path]" > $SETUP_FILE
+echo "set link_library [list your_library.db]" >> $SETUP_FILE
+echo "set target_library [list your_library.db]" >> $SETUP_FILE
+echo "set symbol_library [list your_library.sdb]" >> $SETUP_FILE
+echo "define_design_lib work -path work" >> $SETUP_FILE
+
+# Run synthesis
+mkdir work
+dc_shell -tcl_mode -f $FILELIST_DC 2>&1 | tee synth.log
+
build_dc
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: compile_test
===================================================================
--- compile_test (nonexistent)
+++ compile_test (revision 54)
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Compile a test for the M1 and build the memory.hex file.
+#
+# Parameter is test name without extension (e.g. to compile
+# $M1_ROOT/tests/hello.c) run "compile_test hello".
+#
+# Requires mipsel-linux-gcc (see Download section on srisc.com).
+
+if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
+if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
+
+cd $M1_ROOT/tests
+rm -f *.o *~ *.bin # Make clean
+if ( test $# != 1 ) then
+ echo ""
+ echo "compile_test - Script to compile a test for the M1 Core"
+ echo ""
+ echo "(C)2008 Simply RISC"
+ echo ""
+ echo "Usage:"
+ echo ""
+ echo " compile_test "
+ echo ""
+ echo "where parameter is the test name without extension (e.g. 'hello')."
+ echo ""
+ exit 1
+fi
+if ( ! test -e $1.c ) then
+ echo "ERROR: Test $1.c does not exist into the tests directory!"
+ exit 1
+fi
+
+mipsel-linux-gcc -c -O0 -msoft-float -mips1 $M1_ROOT/tests/boot/boot.s
+mipsel-linux-gcc -c -O0 -msoft-float -mips1 $1.c
+mipsel-linux-ld -Ur -EL -O0 -G 0 -o $1.bin boot.o $1.o
+mipsel-linux-objdump -d -EL -w -z --disassembler-options=no-aliases,reg-names=numeric $1.bin > $1.dump
+cat $1.dump | dump2vlog.php -q > $M1_ROOT/hdl/rtl/m1_core/m1_mmu_initial.vh
+
+echo "The initial content of the instruction memory has been updated successfully!"
+echo "Now you should run 'build_icarus' script again."
+
+rm -f *.o *~ *.bin # Make clean
+
compile_test
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: run_icarus
===================================================================
--- run_icarus (nonexistent)
+++ run_icarus (revision 54)
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
+if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
+
+cd $M1_ROOT/run/sim/icarus
+./testbench > sim.log
+echo "Simulation completed!"
+echo "To see the output:"
+echo " less $M1_ROOT/run/sim/icarus/sim.log"
+echo "Too watch the waveforms:"
+echo " gtkwave $M1_ROOT/run/sim/icarus/trace.vcd"
+
run_icarus
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: build_xst
===================================================================
--- build_xst (nonexistent)
+++ build_xst (revision 54)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
+if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
+
+cd $M1_ROOT/run/synth/xst
+rm -rf * # Make clean
+
+# Set variables
+export DESIGN_TOP="spartan3esk_top"
+export FPGA_DEVICE="xc3s500e-fg320-4"
+export CMDFILE="command.xst"
+export LOGFILE="synth.log"
+
+# Create command file
+echo "run" > $CMDFILE
+echo "-ifn $FILELIST_XST" >> $CMDFILE
+echo "-ifmt MIXED" >> $CMDFILE
+echo "-ofn $DESIGN_TOP.ngc" >> $CMDFILE
+echo "-ofmt NGC" >> $CMDFILE
+echo "-top $DESIGN_TOP" >> $CMDFILE
+echo "-opt_mode SPEED" >> $CMDFILE
+echo "-opt_level 1" >> $CMDFILE
+echo "-p $FPGA_DEVICE" >> $CMDFILE
+
+# Run the complete Xilinx flow from synthesis to bitstream
+xst -ifn $CMDFILE -ofn $LOGFILE
+ngdbuild -p $FPGA_DEVICE -uc ${M1_ROOT}/hdl/rtl/${DESIGN_TOP}/${DESIGN_TOP}.ucf ${DESIGN_TOP}.ngc 2>&1 | tee --append ${LOGFILE}
+map -pr b -p $FPGA_DEVICE $DESIGN_TOP 2>&1 | tee --append $LOGFILE
+par -w -ol high $DESIGN_TOP ${DESIGN_TOP}_par.ncd 2>&1 | tee --append $LOGFILE
+trce -v 25 ${DESIGN_TOP}_par.ncd ${DESIGN_TOP}.pcf 2>&1 | tee --append $LOGFILE
+bitgen ${DESIGN_TOP}_par.ncd -l -w ${DESIGN_TOP}.bit 2>&1 | tee --append $LOGFILE
+
+# Now just use impact to program the device with the bit file... and have fun!!!
+
build_xst
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: build_icarus
===================================================================
--- build_icarus (nonexistent)
+++ build_icarus (revision 54)
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ -z "$M1_ROOT" ]; then echo "***ERROR***: M1_ROOT variable is undefined, please set it and run 'source sourceme'."; exit 1; fi
+if ! [ -d "$M1_ROOT" ]; then echo "***ERROR***: directory '$M1_ROOT' does not exist, please check it and run 'source sourceme' again."; exit 1; fi
+
+rm -rf $M1_ROOT/run/sim/icarus
+mkdir $M1_ROOT/run/sim/icarus
+cd $M1_ROOT/run/sim/icarus
+iverilog -o testbench -c$FILELIST_ICARUS 2>&1 | tee build.log
+
build_icarus
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: dump2hex.php
===================================================================
--- dump2hex.php (nonexistent)
+++ dump2hex.php (revision 54)
@@ -0,0 +1,27 @@
+#!/usr/bin/php -q
+
+
dump2hex.php
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property