URL
https://opencores.org/ocsvn/openmsp430/openmsp430/trunk
Subversion Repositories openmsp430
Compare Revisions
- This comparison shows the changes necessary to convert path
/openmsp430/trunk/core/sim
- from Rev 149 to Rev 151
- ↔ Reverse comparison
Rev 149 → Rev 151
/rtl_sim/src/dbg_mem.v
201,12 → 201,12
dbg_uart_wr(MEM_CTL, 16'h0003); // write register |
repeat(20) @(posedge mclk); |
if (timerA_0.taccr0 !== 16'haed8) tb_error("====== Peripheral (16b): Write @0x0172 ====="); |
dbg_uart_wr(MEM_ADDR, (`DMEM_BASE-16'h0070+16'h0002)); // select memory address |
dbg_uart_wr(MEM_ADDR, (((`DMEM_BASE-16'h0070)&16'h7ff8)+16'h0002)); // select memory address |
dbg_uart_wr(MEM_DATA, 16'hdead); // write data |
dbg_uart_wr(MEM_CTL, 16'h0003); // write memory |
repeat(20) @(posedge mclk); |
if (template_periph_16b_0.cntrl2 !== 16'hdead) tb_error("====== Peripheral (16b): Write @(DMEM_BASE-0x0070+0x0002) ====="); |
dbg_uart_wr(MEM_ADDR, (`DMEM_BASE-16'h0070+16'h0006)); // select memory address |
dbg_uart_wr(MEM_ADDR, (((`DMEM_BASE-16'h0070)&16'h7ff8)+16'h0006)); // select memory address |
dbg_uart_wr(MEM_DATA, 16'hbeef); // write data |
dbg_uart_wr(MEM_CTL, 16'h0003); // write memory |
repeat(20) @(posedge mclk); |
221,12 → 221,12
dbg_uart_wr(MEM_CTL, 16'h0001); // read memory |
dbg_uart_rd(MEM_DATA); // read data |
if (dbg_uart_buf !== 16'haed8) tb_error("====== Peripheral (16b): Read @0x0172 ====="); |
dbg_uart_wr(MEM_ADDR, (`DMEM_BASE-16'h0070+16'h0002)); // select memory address |
dbg_uart_wr(MEM_ADDR, (((`DMEM_BASE-16'h0070)&16'h7ff8)+16'h0002)); // select memory address |
dbg_uart_wr(MEM_CTL, 16'h0001); // read memory |
dbg_uart_rd(MEM_DATA); // read data |
repeat(20) @(posedge mclk); |
if (dbg_uart_buf !== 16'hdead) tb_error("====== Peripheral (16b): Read @(DMEM_BASE-0x0070+0x0002) ====="); |
dbg_uart_wr(MEM_ADDR, (`DMEM_BASE-16'h0070+16'h0006)); // select memory address |
dbg_uart_wr(MEM_ADDR, (((`DMEM_BASE-16'h0070)&16'h7ff8)+16'h0006)); // select memory address |
dbg_uart_wr(MEM_CTL, 16'h0001); // read memory |
dbg_uart_rd(MEM_DATA); // read data |
repeat(20) @(posedge mclk); |
/rtl_sim/src/template_periph_16b.s43
39,12 → 39,12
|
.global main |
|
.set UNUSED_0, (DMEM_BASE-0x0070-0x0002) |
.set CNTRL1, (DMEM_BASE-0x0070+0x0000) |
.set CNTRL2, (DMEM_BASE-0x0070+0x0002) |
.set CNTRL3, (DMEM_BASE-0x0070+0x0004) |
.set CNTRL4, (DMEM_BASE-0x0070+0x0006) |
.set UNUSED_1, (DMEM_BASE-0x0070-0x0008) |
.set UNUSED_0, (((DMEM_BASE-0x0070)&0x7ff8)-0x0002) |
.set CNTRL1, (((DMEM_BASE-0x0070)&0x7ff8)+0x0000) |
.set CNTRL2, (((DMEM_BASE-0x0070)&0x7ff8)+0x0002) |
.set CNTRL3, (((DMEM_BASE-0x0070)&0x7ff8)+0x0004) |
.set CNTRL4, (((DMEM_BASE-0x0070)&0x7ff8)+0x0006) |
.set UNUSED_1, (((DMEM_BASE-0x0070)&0x7ff8)-0x0008) |
|
main: |
/* -------------- TEST RD/WR REGISTER ACCESS --------------- */ |
/rtl_sim/bin/msp430sim
122,37 → 122,23
ln -s $verfile stimulus.v |
fi |
|
# Make local copy of the openMSP403 configuration file and remove comments |
cp $incfile ./pmem.inc |
sed -i "/^\/\// s,.*,," pmem.inc |
# Make local copy of the openMSP403 configuration file |
# and prepare it for MSPGCC preprocessing |
cp $incfile ./pmem.h |
sed -i 's/`ifdef/#ifdef/g' ./pmem.h |
sed -i 's/`else/#else/g' ./pmem.h |
sed -i 's/`endif/#endif/g' ./pmem.h |
sed -i 's/`define/#define/g' ./pmem.h |
sed -i 's/`//g' ./pmem.h |
sed -i "s/'//g" ./pmem.h |
|
# Get Program Memory size |
pmemunit=`grep PMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f4` |
pmemsize=`grep PMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f3` |
pmemsize=${pmemsize/p/.} |
if [ $pmemunit == "KB" ] |
then |
pmemsize=`echo "pmemsize=$pmemsize * 1024; pmemsize /= 1; pmemsize" | bc` |
fi |
# Use MSPGCC preprocessor to extract the Program, Data |
# and Peripheral memory sizes |
msp430-gcc -E -P -x c ../bin/omsp_config.sh > pmem.sh |
|
# Get Data Memory size |
dmemunit=`grep DMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f4` |
dmemsize=`grep DMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f3` |
dmemsize=${dmemsize/p/.} |
if [ $dmemunit == "KB" ] |
then |
dmemsize=`echo "dmemsize=$dmemsize * 1024; dmemsize /= 1; dmemsize" | bc` |
fi |
# Source the extracted configuration file |
source pmem.sh |
|
# Get Peripheral Address space size |
perunit=`grep PER_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f4` |
persize=`grep PER_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f3` |
persize=${persize/p/.} |
if [ $perunit == "KB" ] |
then |
persize=`echo "persize=$persize * 1024; persize /= 1; persize" | bc` |
fi |
|
# Compile assembler code |
echo "Compile, link & generate IHEX file (Program Memory: $pmemsize B, Data Memory: $dmemsize B, Peripheral Space: $persize B)..." |
../bin/asm2ihex.sh pmem pmem.s43 $linkfile $headfile $pmemsize $dmemsize $persize |
/rtl_sim/bin/msp430sim_c
103,30 → 103,25
echo "| Start simulation: $1" |
echo " =======================================================" |
|
# Make local copy of the openMSP403 configuration file and remove comments |
cp $incfile ./pmem.inc |
sed -i "/^\/\// s,.*,," pmem.inc |
# Make local copy of the openMSP403 configuration file |
# and prepare it for MSPGCC preprocessing |
cp $incfile ./pmem.h |
sed -i 's/`ifdef/#ifdef/g' ./pmem.h |
sed -i 's/`else/#else/g' ./pmem.h |
sed -i 's/`endif/#endif/g' ./pmem.h |
sed -i 's/`define/#define/g' ./pmem.h |
sed -i 's/`//g' ./pmem.h |
sed -i "s/'//g" ./pmem.h |
|
# Get Program memory size |
pmemunit=`grep PMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f4` |
pmemsize=`grep PMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f3` |
pmemsize=${pmemsize/p/.} |
if [ $pmemunit == "KB" ] |
then |
pmemsize=`echo "pmemsize=$pmemsize * 1024; pmemsize /= 1; pmemsize" | bc` |
fi |
# Use MSPGCC preprocessor to extract the Program, Data |
# and Peripheral memory sizes |
msp430-gcc -E -P -x c ../bin/omsp_config.sh > pmem.sh |
|
# Get Data Memory size |
dmemunit=`grep DMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f4` |
dmemsize=`grep DMEM_SIZE_ pmem.inc | grep -v ifdef | grep -v "//" | cut -d'_' -f3` |
dmemsize=${dmemsize/p/.} |
if [ $dmemunit == "KB" ] |
then |
dmemsize=`echo "dmemsize=$dmemsize * 1024; dmemsize /= 1; dmemsize" | bc` |
fi |
# Source the extracted configuration file |
source pmem.sh |
|
# Make C program |
echo "Compile, link & generate IHEX file (Program Memory: $pmemsize B, Data Memory: $dmemsize B)..." |
echo "Compile, link & generate IHEX file (Program Memory: $pmemsize B, Data Memory: $dmemsize B, Peripheral Space: $persize B)..." |
cd $softdir |
make clean |
make |
/rtl_sim/bin/omsp_config.sh
0,0 → 1,5
#include "../run/pmem.h" |
|
pmemsize=PMEM_SIZE |
dmemsize=DMEM_SIZE |
persize=PER_SIZE |
rtl_sim/bin/omsp_config.sh
Property changes :
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property