URL
https://opencores.org/ocsvn/s1_core/s1_core/trunk
Subversion Repositories s1_core
Compare Revisions
- This comparison shows the changes necessary to convert path
/s1_core/trunk/tools/bin
- from Rev 111 to Rev 113
- ↔ Reverse comparison
Rev 111 → Rev 113
/compile_test
6,7 → 6,7
# Parameter is test name without extension (e.g. to compile |
# $S1_ROOT/tests/hello.c) just run "compile_test hello". |
# |
# Note: requires sparc-linux-gnu-gcc from emdebian.org |
# Note: requires sparc64-linux-gcc from emdebian.org |
|
test_var S1_ROOT |
|
13,7 → 13,7
# Prepare the environment |
cd $S1_ROOT/tests |
rm -f *.o *~ *.bin *.dump *.hex # Make clean |
if ( test $# != 1 ) then |
if [ $# -ne 1 ]; then |
echo "compile_test - Script to compile a test for the S1 Core"; |
echo "(C) 2006 by Simply RISC"; |
echo "Usage:"; |
21,7 → 21,7
echo "where parameter is the test name without extension (e.g. 'hello')."; |
exit 1; |
fi |
if ( ! test -e $1.c ) then |
if ! [ -e $1.c ]; then |
echo "ERROR: Test $1.c does not exist into the tests directory!"; |
exit 1; |
fi |
30,15 → 30,18
gcc -o $S1_ROOT/tools/bin/dump2hex.bin $S1_ROOT/tools/src/dump2hex.c |
|
# Compile the boot code |
sparc-linux-gnu-as -xarch=v9b -ah -am -o boot/boot.bin boot/boot.s |
sparc-linux-gnu-objdump -d -EB -w -z boot/boot.bin > boot/boot.dump |
sparc64-linux-as -xarch=v9b -ah -am -o boot/boot.bin boot/boot.s |
sparc64-linux-objdump -d -EB -w -z boot/boot.bin > boot/boot.dump |
grep " " boot/boot.dump | egrep -v "file format" | dump2hex.bin > boot/rom_harness.hex |
ln -s boot/boot.dump boot/rom_harness.dis |
|
# Compile the C test |
sparc-linux-gnu-gcc -c -O0 $1.c |
sparc-linux-gnu-ld -Ur --script=$S1_ROOT/tools/src/linker.map -EB -o $1.bin $1.o |
sparc-linux-gnu-objdump -d -EB -w -z $1.bin > $1.dump |
sparc64-linux-gcc -c -O0 $1.c |
sparc64-linux-ld -Ur --script=$S1_ROOT/tools/src/linker.map -EB -o $1.bin $1.o |
sparc64-linux-objdump -d -EB -w -z $1.bin > $1.dump |
grep " " $1.dump | egrep -v "file format" | dump2hex.bin > ram_harness.hex |
ln -s $1.dump ram_harness.dis |
|
#rm -f *.o *~ *.bin *.dump # Make clean |
echo "Test compiled!" |
|
/opcode2disass.sh
0,0 → 1,23
#!/bin/bash -e |
|
# Read input argument |
opcode=$1 |
|
# File names |
tmp_src="tmp$$.s" |
tmp_out="tmp$$.o" |
rm -f $tmp_src $tmp_out |
|
# Create temporary source file |
echo " |
.text |
.word $opcode |
" > $tmp_src |
|
# Compile and dump |
sparc64-linux-gcc -c $tmp_src |
sparc64-linux-objdump -d $tmp_out | tail -n 1 | cut -b 20- |
|
# Final cleanup |
rm -f $tmp_src $tmp_out |
|
opcode2disass.sh
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: s1_sim_build
===================================================================
--- s1_sim_build (revision 111)
+++ s1_sim_build (revision 113)
@@ -1,27 +1,28 @@
#!/bin/bash
-set -e
-if ( (test $# != 1) || ((test $1 != "icarus") && (test $1 != "vcs")) ) then
+simulator=$1
+if ! [ "$simulator" == "icarus" ] && ! [ "$simulator" == "vcs" ]; then
echo "Usage: $0 {icarus|vcs}"
exit 1
fi
+
test_var S1_ROOT
-echo -e "Building design and testbench using $1"
-mkdir -p $S1_ROOT/run/sim/$1
-cd $S1_ROOT/run/sim/$1
+echo -e "Building design and testbench using $simulator"
+mkdir -p $S1_ROOT/run/sim/$simulator
+cd $S1_ROOT/run/sim/$simulator
rm -rf *
-if(test $1 == "icarus") then
- iverilog -o testbench -c$FILELIST_ICARUS
+if [ "$simulator" == "icarus" ]; then
+ iverilog -D CMP_CLK_PERIOD=1 -g2012 -o testbench -c$FILELIST_ICARUS
fi
-if(test $1 == "vcs") then
+if [ "$simulator" == "vcs" ]; then
vcs +cli -line -timescale=1ns/100ps -f $FILELIST_VCS
mv -f simv testbench
mv -f simv.daidir testbench.daidir
fi
-echo -e "Build with $1 done!"
+echo -e "Build with $simulator done!"
/s1_sim_run
10,7 → 10,9
echo -e "Running simulation using $1" |
cd $S1_ROOT/run/sim/$1 |
ln -f -s $S1_ROOT/tests/boot/rom_harness.hex . |
ln -f -s $S1_ROOT/tests/boot/rom_harness.dis . |
ln -f -s $S1_ROOT/tests/ram_harness.hex . |
ln -f -s $S1_ROOT/tests/ram_harness.dis . |
./testbench 2>&1 | tee sim.log |
|
#if(test $1 == "icarus") then |
/tracan.sh
0,0 → 1,24
#!/bin/bash -e |
|
# Take from the trace.vcd file (passed as argument) |
# only the lines of outgoing and incoming packets |
# (read README.txt for details). |
|
if [ $# != 1 ]; then |
echo "Tracan - Trace Analyzer" |
echo "(C) 2006 by Simply RISC" |
echo "Usage:" |
echo " tracan <VCDFILE>" |
echo "" |
exit 1 |
fi |
|
# VCD symbols as defined in tracan.h |
#const char VCD_ID_PCX_REQ = '!'; |
#const char VCD_ID_PCX_ATOM = '^'; |
#const char VCD_ID_PCX_DATA = '"'; |
#const char VCD_ID_PCX_GRANT = 'f'; |
#const char VCD_ID_CPX_READY = '#'; |
#const char VCD_ID_CPX_DATA = '$'; |
egrep ' \!$|^1\^$| "$| f$| #$| \$$' $1 | egrep -v "x|b00000 " | sed -e 's/^b//g' | sed -e 's/1^/1 ^/g' | tracan.bin |
|
tracan.sh
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: tracan_compile.sh
===================================================================
--- tracan_compile.sh (nonexistent)
+++ tracan_compile.sh (revision 113)
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+gcc -o $S1_ROOT/tools/bin/tracan.bin $S1_ROOT/tools/src/tracan.cpp
+
tracan_compile.sh
Property changes :
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: update_sparccore
===================================================================
--- update_sparccore (revision 111)
+++ update_sparccore (revision 113)
@@ -57,80 +57,80 @@
sync_pulse_synchronizer.v synchronizer_asr_dup.v ucb_bus_in.v ucb_bus_out.v ucb_flow_2buf.v \
ucb_flow_jbi.v ucb_flow_spi.v ucb_noflow.v spc_pcx_buf.v
-# Clean the files by substituting the $error System Task and applying defines with Icarus preprocessor
-for file in $DST_DIR/*.v ; do
- sed -e 's/\$error/\$display/g' $file | sed -e 's/negedge rclk or rst_l/negedge rclk/g' > $DST_DIR/temp.v
- if(test $1 == "-me" || test $1 == "-se") then
- iverilog -E -D CMP_CLK_PERIOD=1 -D FPGA_SYN -D FPGA_SYN_1THREAD -D FPGA_SYN_NO_SPU -I $DST_DIR/include -o$file $DST_DIR/temp.v
- else
- iverilog -E -D CMP_CLK_PERIOD=1 -D FPGA_SYN -D FPGA_SYN_NO_SPU -I $DST_DIR/include -o$file $DST_DIR/temp.v
- fi
- # These steps are required because Icarus does not allow this kind of comments
- sed -e 's/\* ========== Copyright Header Begin/\/\* ========== Copyright Header Begin/g' $file > $DST_DIR/temp.v
- mv -f $DST_DIR/temp.v $file
-done
+## Clean the files by substituting the $error System Task and applying defines with Icarus preprocessor
+#for file in $DST_DIR/*.v ; do
+# sed -e 's/\$error/\$display/g' $file | sed -e 's/negedge rclk or rst_l/negedge rclk/g' > $DST_DIR/temp.v
+# if(test $1 == "-me" || test $1 == "-se") then
+# iverilog -E -D CMP_CLK_PERIOD=1 -D FPGA_SYN -D FPGA_SYN_1THREAD -D FPGA_SYN_NO_SPU -I $DST_DIR/include -o$file $DST_DIR/temp.v
+# else
+# iverilog -E -D CMP_CLK_PERIOD=1 -D FPGA_SYN -D FPGA_SYN_NO_SPU -I $DST_DIR/include -o$file $DST_DIR/temp.v
+# fi
+# # These steps are required because Icarus does not allow this kind of comments
+# sed -e 's/\* ========== Copyright Header Begin/\/\* ========== Copyright Header Begin/g' $file > $DST_DIR/temp.v
+# mv -f $DST_DIR/temp.v $file
+#done
-# Correct some strange strings
-sed -e 's/sparc_exu_alulogic logic/sparc_exu_alulogic logic_MAYBEARESERVEDWORD/g' $DST_DIR/sparc_exu_alu.v > $DST_DIR/temp.v
-mv $DST_DIR/temp.v $DST_DIR/sparc_exu_alu.v
-sed -e 's/logic/logic_MAYBEARESERVEDWORD/g' $DST_DIR/sparc_ffu_ctl_visctl.v > $DST_DIR/temp.v
-mv $DST_DIR/temp.v $DST_DIR/sparc_ffu_ctl_visctl.v
-sed -e 's/$display(\"ILLEGAL_THR_STATE\"/\/\/$display(\"ILLEGAL_THR_STATE\"/g' sparc_ifu_thrfsm.v > $DST_DIR/temp.v
-mv $DST_DIR/temp.v $DST_DIR/sparc_ifu_thrfsm.v
-sed -e 's/(\* keep = "yes" \*)//g' $DST_DIR/bw_r_frf.v > $DST_DIR/temp.v
-mv $DST_DIR/temp.v $DST_DIR/bw_r_frf.v
-sed -e 's/synthesis translate_/synopsys translate_/g' $DST_DIR/bw_r_irf.v > $DST_DIR/temp.v
-mv $DST_DIR/temp.v $DST_DIR/bw_r_irf.v
-sed -e 's/initial onereg/\/\/initial onereg/g' $DST_DIR/bw_r_irf_register.v > $DST_DIR/temp.v
-mv $DST_DIR/temp.v $DST_DIR/bw_r_irf_register.v
+## Correct some strange strings
+#sed -e 's/sparc_exu_alulogic logic/sparc_exu_alulogic logic_MAYBEARESERVEDWORD/g' $DST_DIR/sparc_exu_alu.v > $DST_DIR/temp.v
+#mv $DST_DIR/temp.v $DST_DIR/sparc_exu_alu.v
+#sed -e 's/logic/logic_MAYBEARESERVEDWORD/g' $DST_DIR/sparc_ffu_ctl_visctl.v > $DST_DIR/temp.v
+#mv $DST_DIR/temp.v $DST_DIR/sparc_ffu_ctl_visctl.v
+#sed -e 's/$display(\"ILLEGAL_THR_STATE\"/\/\/$display(\"ILLEGAL_THR_STATE\"/g' sparc_ifu_thrfsm.v > $DST_DIR/temp.v
+#mv $DST_DIR/temp.v $DST_DIR/sparc_ifu_thrfsm.v
+#sed -e 's/(\* keep = "yes" \*)//g' $DST_DIR/bw_r_frf.v > $DST_DIR/temp.v
+#mv $DST_DIR/temp.v $DST_DIR/bw_r_frf.v
+#sed -e 's/synthesis translate_/synopsys translate_/g' $DST_DIR/bw_r_irf.v > $DST_DIR/temp.v
+#mv $DST_DIR/temp.v $DST_DIR/bw_r_irf.v
+#sed -e 's/initial onereg/\/\/initial onereg/g' $DST_DIR/bw_r_irf_register.v > $DST_DIR/temp.v
+#mv $DST_DIR/temp.v $DST_DIR/bw_r_irf_register.v
-# After preprocessing we can safely delete the include directory
-rm -f $DST_DIR/include/*.*
+## After preprocessing we can safely delete the include directory
+#rm -f $DST_DIR/include/*.*
-# Disable L1 Instruction and Data Caches if required
-if(test $1 == "-me") then
- cp -f $S1_ROOT/tools/src/bw_r_dcd.v $DST_DIR
- cp -f $S1_ROOT/tools/src/bw_r_icd.v $DST_DIR
- cp -f $S1_ROOT/tools/src/bw_r_idct.v $DST_DIR
-fi
+## Disable L1 Instruction and Data Caches if required
+#if(test $1 == "-me") then
+# cp -f $S1_ROOT/tools/src/bw_r_dcd.v $DST_DIR
+# cp -f $S1_ROOT/tools/src/bw_r_icd.v $DST_DIR
+# cp -f $S1_ROOT/tools/src/bw_r_idct.v $DST_DIR
+#fi
-# Hack the SPARC Core to add the external stall input from the bridge
-# Cookbook from book "OpenSPARC Internals", paragraph 6.8
+## Hack the SPARC Core to add the external stall input from the bridge
+## Cookbook from book "OpenSPARC Internals", paragraph 6.8
-# Top-level of SPARC Core (s1_top.sparc)
-sed -e 's/pcx_spc_grant_px,/pcx_spc_grant_px,wbm_spc_stall,wbm_spc_resume,/g' $DST_DIR/sparc.v |
- sed -e 's/pcx_spc_grant_px;/pcx_spc_grant_px;input wbm_spc_stall;input wbm_spc_resume;/g' |
- sed -e 's/sparc_ifu ifu(/sparc_ifu ifu(.wbm_spc_stall(wbm_spc_stall),.wbm_spc_resume(wbm_spc_resume),/g' > $DST_DIR/sparc_TMP.v
-mv -f $DST_DIR/sparc_TMP.v $DST_DIR/sparc.v
+## Top-level of SPARC Core (s1_top.sparc)
+#sed -e 's/pcx_spc_grant_px,/pcx_spc_grant_px,wbm_spc_stall,wbm_spc_resume,/g' $DST_DIR/sparc.v |
+# sed -e 's/pcx_spc_grant_px;/pcx_spc_grant_px;input wbm_spc_stall;input wbm_spc_resume;/g' |
+# sed -e 's/sparc_ifu ifu(/sparc_ifu ifu(.wbm_spc_stall(wbm_spc_stall),.wbm_spc_resume(wbm_spc_resume),/g' > $DST_DIR/sparc_TMP.v
+#mv -f $DST_DIR/sparc_TMP.v $DST_DIR/sparc.v
-# Fetch unit (s1_top.sparc.ifu)
-sed -e 's/ffu_ifu_stallreq,/ffu_ifu_stallreq,wbm_spc_stall,wbm_spc_resume,/g' $DST_DIR/sparc_ifu.v |
- sed -e 's/ffu_ifu_stallreq;/ffu_ifu_stallreq;input wbm_spc_stall;input wbm_spc_resume;/g' |
- sed -e 's/sparc_ifu_swl swl(/sparc_ifu_swl swl(.wbm_spc_stall(wbm_spc_stall),.wbm_spc_resume(wbm_spc_resume),/g' > $DST_DIR/sparc_ifu_TMP.v
-mv -f $DST_DIR/sparc_ifu_TMP.v $DST_DIR/sparc_ifu.v
+## Fetch unit (s1_top.sparc.ifu)
+#sed -e 's/ffu_ifu_stallreq,/ffu_ifu_stallreq,wbm_spc_stall,wbm_spc_resume,/g' $DST_DIR/sparc_ifu.v |
+# sed -e 's/ffu_ifu_stallreq;/ffu_ifu_stallreq;input wbm_spc_stall;input wbm_spc_resume;/g' |
+# sed -e 's/sparc_ifu_swl swl(/sparc_ifu_swl swl(.wbm_spc_stall(wbm_spc_stall),.wbm_spc_resume(wbm_spc_resume),/g' > $DST_DIR/sparc_ifu_TMP.v
+#mv -f $DST_DIR/sparc_ifu_TMP.v $DST_DIR/sparc_ifu.v
-# Switch logic unit (s1_top.sparc.ifu.swl)
-sed -e 's/thr_config_in_m,/thr_config_in_m,wbm_spc_stall,wbm_spc_resume,/g' $DST_DIR/sparc_ifu_swl.v |
- sed -e 's/thr_config_in_m;/thr_config_in_m;input wbm_spc_stall;input wbm_spc_resume;wire wait_state;/g' |
- sed -e 's/sparc_ifu_thrcmpl compl(/sparc_ifu_thrcmpl compl(.wbm_spc_stall(wbm_spc_stall),.wbm_spc_resume(wbm_spc_resume),.wait_state(wait_state),/g' |
- sed -e 's/(~wm_stbwait | stb_retry);/(~wm_stbwait|stb_retry)\&(~wait_state|wbm_spc_resume);/g' |
- sed -e 's/wm_stbwait & ~stb_retry);/wm_stbwait \& ~stb_retry|wait_state \& ~wbm_spc_resume);/g' > $DST_DIR/sparc_ifu_swl_TMP.v
-mv -f $DST_DIR/sparc_ifu_swl_TMP.v $DST_DIR/sparc_ifu_swl.v
+## Switch logic unit (s1_top.sparc.ifu.swl)
+#sed -e 's/thr_config_in_m,/thr_config_in_m,wbm_spc_stall,wbm_spc_resume,/g' $DST_DIR/sparc_ifu_swl.v |
+# sed -e 's/thr_config_in_m;/thr_config_in_m;input wbm_spc_stall;input wbm_spc_resume;wire wait_state;/g' |
+# sed -e 's/sparc_ifu_thrcmpl compl(/sparc_ifu_thrcmpl compl(.wbm_spc_stall(wbm_spc_stall),.wbm_spc_resume(wbm_spc_resume),.wait_state(wait_state),/g' |
+# sed -e 's/(~wm_stbwait | stb_retry);/(~wm_stbwait|stb_retry)\&(~wait_state|wbm_spc_resume);/g' |
+# sed -e 's/wm_stbwait & ~stb_retry);/wm_stbwait \& ~stb_retry|wait_state \& ~wbm_spc_resume);/g' > $DST_DIR/sparc_ifu_swl_TMP.v
+#mv -f $DST_DIR/sparc_ifu_swl_TMP.v $DST_DIR/sparc_ifu_swl.v
-# Stall completion logic (s1_top.sparc.ifu.swl.compl)
-sed -e 's/clear_wmo_e,/clear_wmo_e,wbm_spc_stall,wbm_spc_resume,wait_state,/g' $DST_DIR/sparc_ifu_thrcmpl.v |
- sed -e 's/clear_wmo_e;/clear_wmo_e;input wbm_spc_stall;input wbm_spc_resume;output wait_state;wire wait_next;/g' |
- sed -e 's/endmodule/assign wait_next=wbm_spc_stall|(wait_state \& ~wbm_spc_resume);\nendmodule/g' |
- sed -e 's/endmodule/dffr wait_ff(.din(wait_next),.q(wait_state),.clk(clk),.rst(reset),.se(se),.si(),.so());\nendmodule/g' |
- sed -e 's/assign completion/assign completion[0]/g' |
- sed -e 's/endmodule/assign completion[1]=completion[0];\nendmodule/g' |
- sed -e 's/endmodule/assign completion[2]=completion[0];\nendmodule/g' |
- sed -e 's/endmodule/assign completion[3]=completion[0];\nendmodule/g' |
- sed -e 's/wm_stbwait));/wm_stbwait|wait_state));/g' > $DST_DIR/sparc_ifu_thrcmpl_TMP.v
-mv -f $DST_DIR/sparc_ifu_thrcmpl_TMP.v $DST_DIR/sparc_ifu_thrcmpl.v
+## Stall completion logic (s1_top.sparc.ifu.swl.compl)
+#sed -e 's/clear_wmo_e,/clear_wmo_e,wbm_spc_stall,wbm_spc_resume,wait_state,/g' $DST_DIR/sparc_ifu_thrcmpl.v |
+# sed -e 's/clear_wmo_e;/clear_wmo_e;input wbm_spc_stall;input wbm_spc_resume;output wait_state;wire wait_next;/g' |
+# sed -e 's/endmodule/assign wait_next=wbm_spc_stall|(wait_state \& ~wbm_spc_resume);\nendmodule/g' |
+# sed -e 's/endmodule/dffr wait_ff(.din(wait_next),.q(wait_state),.clk(clk),.rst(reset),.se(se),.si(),.so());\nendmodule/g' |
+# sed -e 's/assign completion/assign completion[0]/g' |
+# sed -e 's/endmodule/assign completion[1]=completion[0];\nendmodule/g' |
+# sed -e 's/endmodule/assign completion[2]=completion[0];\nendmodule/g' |
+# sed -e 's/endmodule/assign completion[3]=completion[0];\nendmodule/g' |
+# sed -e 's/wm_stbwait));/wm_stbwait|wait_state));/g' > $DST_DIR/sparc_ifu_thrcmpl_TMP.v
+#mv -f $DST_DIR/sparc_ifu_thrcmpl_TMP.v $DST_DIR/sparc_ifu_thrcmpl.v
-# This is a temporary hack to take a top-level SPARC Core with the SPU instance removed by-hand (ifdef is wrong)
-cp -f $S1_ROOT/tools/src/sparc.v $DST_DIR
+## This is a temporary hack to take a top-level SPARC Core with the SPU instance removed by-hand (ifdef is wrong)
+#cp -f $S1_ROOT/tools/src/sparc.v $DST_DIR
# Copy also behavioral libraries used for RTL simulations
DST_DIR=$S1_ROOT/hdl/behav/sparc_libs