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

Subversion Repositories openmsp430

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openmsp430
    from Rev 150 to Rev 151
    Reverse comparison

Rev 150 → Rev 151

/trunk/doc/openMSP430.pdf Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/trunk/doc/openMSP430.odt Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
/trunk/core/bench/verilog/tb_openMSP430.v
513,7 → 513,7
`ifdef CVER
template_periph_16b #(15'h0190) template_periph_16b_0 (
`else
template_periph_16b #(.BASE_ADDR(15'd`PER_SIZE-15'h0070)) template_periph_16b_0 (
template_periph_16b #(.BASE_ADDR((15'd`PER_SIZE-15'h0070) & 15'h7ff8)) template_periph_16b_0 (
`endif
// OUTPUTs
.per_dout (per_dout_temp_16b), // Peripheral data output
/trunk/core/rtl/verilog/omsp_mem_backbone.v
179,8 → 179,8
 
// Peripherals
//--------------------
wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:`PER_AWIDTH+1]=={15-`PER_AWIDTH{1'b0}});
wire eu_per_en = eu_mb_en & (eu_mab[14:`PER_AWIDTH] =={15-`PER_AWIDTH{1'b0}});
wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:1]<(`PER_SIZE>>1));
wire eu_per_en = eu_mb_en & (eu_mab<(`PER_SIZE>>1));
 
wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out;
wire [1:0] per_we = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
/trunk/core/rtl/verilog/openMSP430_defines.v
59,6 → 59,7
// Program Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define PMEM_SIZE_CUSTOM
//`define PMEM_SIZE_59_KB
//`define PMEM_SIZE_55_KB
//`define PMEM_SIZE_54_KB
78,6 → 79,7
// Data Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define DMEM_SIZE_CUSTOM
//`define DMEM_SIZE_32_KB
//`define DMEM_SIZE_24_KB
//`define DMEM_SIZE_16_KB
168,6 → 170,7
// shifted up and a custom linker script will therefore
// be required by the GCC compiler.
//-------------------------------------------------------
//`define PER_SIZE_CUSTOM
//`define PER_SIZE_32_KB
//`define PER_SIZE_16_KB
//`define PER_SIZE_8_KB
233,6 → 236,31
 
 
//-------------------------------------------------------
// Custom Program/Data and Peripheral Memory Spaces
//-------------------------------------------------------
// The following values are valid only if the
// corresponding *_SIZE_CUSTOM defines are uncommented:
//
// - *_SIZE : size of the section in bytes.
// - *_AWIDTH : address port width, this value must allow
// to address all WORDS of the section
// (i.e. the *_SIZE divided by 2)
//-------------------------------------------------------
 
// Custom Program memory (enabled with PMEM_SIZE_CUSTOM)
`define PMEM_CUSTOM_AWIDTH 10
`define PMEM_CUSTOM_SIZE 2028
 
// Custom Data memory (enabled with DMEM_SIZE_CUSTOM)
`define DMEM_CUSTOM_AWIDTH 6
`define DMEM_CUSTOM_SIZE 128
 
// Custom Peripheral memory (enabled with PER_SIZE_CUSTOM)
`define PER_CUSTOM_AWIDTH 8
`define PER_CUSTOM_SIZE 512
 
 
//-------------------------------------------------------
// ASIC version
//-------------------------------------------------------
// When uncommented, this define will enable the
460,6 → 488,10
`define PMEM_AWIDTH 9
`define PMEM_SIZE 1024
`endif
`ifdef PMEM_SIZE_CUSTOM
`define PMEM_AWIDTH `PMEM_CUSTOM_AWIDTH
`define PMEM_SIZE `PMEM_CUSTOM_SIZE
`endif
 
// Data Memory Size
`ifdef DMEM_SIZE_32_KB
514,6 → 546,10
`define DMEM_AWIDTH 6
`define DMEM_SIZE 128
`endif
`ifdef DMEM_SIZE_CUSTOM
`define DMEM_AWIDTH `DMEM_CUSTOM_AWIDTH
`define DMEM_SIZE `DMEM_CUSTOM_SIZE
`endif
 
// Peripheral Memory Size
`ifdef PER_SIZE_32_KB
544,6 → 580,10
`define PER_AWIDTH 8
`define PER_SIZE 512
`endif
`ifdef PER_SIZE_CUSTOM
`define PER_AWIDTH `PER_CUSTOM_AWIDTH
`define PER_SIZE `PER_CUSTOM_SIZE
`endif
 
// Data Memory Base Adresses
`define DMEM_BASE `PER_SIZE
/trunk/core/sim/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);
/trunk/core/sim/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 --------------- */
/trunk/core/sim/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
/trunk/core/sim/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
/trunk/core/sim/rtl_sim/bin/omsp_config.sh
0,0 → 1,5
#include "../run/pmem.h"
 
pmemsize=PMEM_SIZE
dmemsize=DMEM_SIZE
persize=PER_SIZE
trunk/core/sim/rtl_sim/bin/omsp_config.sh Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: trunk/fpga/xilinx_diligent_s3board/rtl/verilog/openmsp430/omsp_mem_backbone.v =================================================================== --- trunk/fpga/xilinx_diligent_s3board/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 150) +++ trunk/fpga/xilinx_diligent_s3board/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 151) @@ -179,8 +179,8 @@ // Peripherals //-------------------- -wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:`PER_AWIDTH+1]=={15-`PER_AWIDTH{1'b0}}); -wire eu_per_en = eu_mb_en & (eu_mab[14:`PER_AWIDTH] =={15-`PER_AWIDTH{1'b0}}); +wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:1]<(`PER_SIZE>>1)); +wire eu_per_en = eu_mb_en & (eu_mab<(`PER_SIZE>>1)); wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out; wire [1:0] per_we = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
/trunk/fpga/xilinx_diligent_s3board/rtl/verilog/openmsp430/openMSP430_defines.v
59,6 → 59,7
// Program Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define PMEM_SIZE_CUSTOM
//`define PMEM_SIZE_59_KB
//`define PMEM_SIZE_55_KB
//`define PMEM_SIZE_54_KB
78,6 → 79,7
// Data Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define DMEM_SIZE_CUSTOM
//`define DMEM_SIZE_32_KB
//`define DMEM_SIZE_24_KB
//`define DMEM_SIZE_16_KB
168,6 → 170,7
// shifted up and a custom linker script will therefore
// be required by the GCC compiler.
//-------------------------------------------------------
//`define PER_SIZE_CUSTOM
//`define PER_SIZE_32_KB
//`define PER_SIZE_16_KB
//`define PER_SIZE_8_KB
233,6 → 236,31
 
 
//-------------------------------------------------------
// Custom Program/Data and Peripheral Memory Spaces
//-------------------------------------------------------
// The following values are valid only if the
// corresponding *_SIZE_CUSTOM defines are uncommented:
//
// - *_SIZE : size of the section in bytes.
// - *_AWIDTH : address port width, this value must allow
// to address all WORDS of the section
// (i.e. the *_SIZE divided by 2)
//-------------------------------------------------------
 
// Custom Program memory (enabled with PMEM_SIZE_CUSTOM)
`define PMEM_CUSTOM_AWIDTH 10
`define PMEM_CUSTOM_SIZE 2048
 
// Custom Data memory (enabled with DMEM_SIZE_CUSTOM)
`define DMEM_CUSTOM_AWIDTH 6
`define DMEM_CUSTOM_SIZE 128
 
// Custom Peripheral memory (enabled with PER_SIZE_CUSTOM)
`define PER_CUSTOM_AWIDTH 8
`define PER_CUSTOM_SIZE 512
 
 
//-------------------------------------------------------
// ASIC version
//-------------------------------------------------------
// When uncommented, this define will enable the
460,6 → 488,10
`define PMEM_AWIDTH 9
`define PMEM_SIZE 1024
`endif
`ifdef PMEM_SIZE_CUSTOM
`define PMEM_AWIDTH `PMEM_CUSTOM_AWIDTH
`define PMEM_SIZE `PMEM_CUSTOM_SIZE
`endif
 
// Data Memory Size
`ifdef DMEM_SIZE_32_KB
514,6 → 546,10
`define DMEM_AWIDTH 6
`define DMEM_SIZE 128
`endif
`ifdef DMEM_SIZE_CUSTOM
`define DMEM_AWIDTH `DMEM_CUSTOM_AWIDTH
`define DMEM_SIZE `DMEM_CUSTOM_SIZE
`endif
 
// Peripheral Memory Size
`ifdef PER_SIZE_32_KB
544,6 → 580,10
`define PER_AWIDTH 8
`define PER_SIZE 512
`endif
`ifdef PER_SIZE_CUSTOM
`define PER_AWIDTH `PER_CUSTOM_AWIDTH
`define PER_SIZE `PER_CUSTOM_SIZE
`endif
 
// Data Memory Base Adresses
`define DMEM_BASE `PER_SIZE
/trunk/fpga/xilinx_diligent_s3board/sim/rtl_sim/bin/msp430sim
116,19 → 116,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
 
# Source the extracted configuration file
source pmem.sh
 
# Create IHEX file from ELF
echo "Convert ELF file to IHEX format..."
msp430-objcopy -O ihex pmem.elf pmem.ihex
/trunk/fpga/xilinx_diligent_s3board/sim/rtl_sim/bin/omsp_config.sh
0,0 → 1,5
#include "../run/pmem.h"
 
pmemsize=PMEM_SIZE
dmemsize=DMEM_SIZE
persize=PER_SIZE
trunk/fpga/xilinx_diligent_s3board/sim/rtl_sim/bin/omsp_config.sh Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: trunk/fpga/altera_de1_board/rtl/verilog/openmsp430/omsp_mem_backbone.v =================================================================== --- trunk/fpga/altera_de1_board/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 150) +++ trunk/fpga/altera_de1_board/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 151) @@ -179,8 +179,8 @@ // Peripherals //-------------------- -wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:`PER_AWIDTH+1]=={15-`PER_AWIDTH{1'b0}}); -wire eu_per_en = eu_mb_en & (eu_mab[14:`PER_AWIDTH] =={15-`PER_AWIDTH{1'b0}}); +wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:1]<(`PER_SIZE>>1)); +wire eu_per_en = eu_mb_en & (eu_mab<(`PER_SIZE>>1)); wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out; wire [1:0] per_we = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
/trunk/fpga/altera_de1_board/rtl/verilog/openmsp430/openMSP430_defines.v
59,6 → 59,7
// Program Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define PMEM_SIZE_CUSTOM
//`define PMEM_SIZE_59_KB
//`define PMEM_SIZE_55_KB
//`define PMEM_SIZE_54_KB
78,6 → 79,7
// Data Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define DMEM_SIZE_CUSTOM
//`define DMEM_SIZE_32_KB
//`define DMEM_SIZE_24_KB
//`define DMEM_SIZE_16_KB
168,6 → 170,7
// shifted up and a custom linker script will therefore
// be required by the GCC compiler.
//-------------------------------------------------------
//`define PER_SIZE_CUSTOM
//`define PER_SIZE_32_KB
//`define PER_SIZE_16_KB
//`define PER_SIZE_8_KB
233,6 → 236,31
 
 
//-------------------------------------------------------
// Custom Program/Data and Peripheral Memory Spaces
//-------------------------------------------------------
// The following values are valid only if the
// corresponding *_SIZE_CUSTOM defines are uncommented:
//
// - *_SIZE : size of the section in bytes.
// - *_AWIDTH : address port width, this value must allow
// to address all WORDS of the section
// (i.e. the *_SIZE divided by 2)
//-------------------------------------------------------
 
// Custom Program memory (enabled with PMEM_SIZE_CUSTOM)
`define PMEM_CUSTOM_AWIDTH 10
`define PMEM_CUSTOM_SIZE 2048
 
// Custom Data memory (enabled with DMEM_SIZE_CUSTOM)
`define DMEM_CUSTOM_AWIDTH 6
`define DMEM_CUSTOM_SIZE 128
 
// Custom Peripheral memory (enabled with PER_SIZE_CUSTOM)
`define PER_CUSTOM_AWIDTH 8
`define PER_CUSTOM_SIZE 512
 
 
//-------------------------------------------------------
// ASIC version
//-------------------------------------------------------
// When uncommented, this define will enable the
460,6 → 488,10
`define PMEM_AWIDTH 9
`define PMEM_SIZE 1024
`endif
`ifdef PMEM_SIZE_CUSTOM
`define PMEM_AWIDTH `PMEM_CUSTOM_AWIDTH
`define PMEM_SIZE `PMEM_CUSTOM_SIZE
`endif
 
// Data Memory Size
`ifdef DMEM_SIZE_32_KB
514,6 → 546,10
`define DMEM_AWIDTH 6
`define DMEM_SIZE 128
`endif
`ifdef DMEM_SIZE_CUSTOM
`define DMEM_AWIDTH `DMEM_CUSTOM_AWIDTH
`define DMEM_SIZE `DMEM_CUSTOM_SIZE
`endif
 
// Peripheral Memory Size
`ifdef PER_SIZE_32_KB
544,6 → 580,10
`define PER_AWIDTH 8
`define PER_SIZE 512
`endif
`ifdef PER_SIZE_CUSTOM
`define PER_AWIDTH `PER_CUSTOM_AWIDTH
`define PER_SIZE `PER_CUSTOM_SIZE
`endif
 
// Data Memory Base Adresses
`define DMEM_BASE `PER_SIZE
/trunk/fpga/altera_de1_board/sim/rtl_sim/bin/msp430sim
119,19 → 119,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
 
# Source the extracted configuration file
source pmem.sh
 
# Create IHEX file from ELF
echo "Convert ELF file to IHEX format..."
msp430-objcopy -O ihex pmem.elf pmem.ihex
/trunk/fpga/altera_de1_board/sim/rtl_sim/bin/omsp_config.sh
0,0 → 1,5
#include "../run/pmem.h"
 
pmemsize=PMEM_SIZE
dmemsize=DMEM_SIZE
persize=PER_SIZE
trunk/fpga/altera_de1_board/sim/rtl_sim/bin/omsp_config.sh Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: trunk/fpga/actel_m1a3pl_dev_kit/rtl/verilog/openmsp430/omsp_mem_backbone.v =================================================================== --- trunk/fpga/actel_m1a3pl_dev_kit/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 150) +++ trunk/fpga/actel_m1a3pl_dev_kit/rtl/verilog/openmsp430/omsp_mem_backbone.v (revision 151) @@ -36,9 +36,9 @@ // - Olivier Girard, olgirard@gmail.com // //---------------------------------------------------------------------------- -// $Rev: 103 $ +// $Rev: 134 $ // $LastChangedBy: olivier.girard $ -// $LastChangedDate: 2011-03-05 15:44:48 +0100 (Sat, 05 Mar 2011) $ +// $LastChangedDate: 2012-03-22 21:31:06 +0100 (Thu, 22 Mar 2012) $ //---------------------------------------------------------------------------- `ifdef OMSP_NO_INCLUDE `else @@ -179,8 +179,8 @@ // Peripherals //-------------------- -wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:`PER_AWIDTH+1]=={15-`PER_AWIDTH{1'b0}}); -wire eu_per_en = eu_mb_en & (eu_mab[14:`PER_AWIDTH] =={15-`PER_AWIDTH{1'b0}}); +wire dbg_per_en = dbg_mem_en & (dbg_mem_addr[15:1]<(`PER_SIZE>>1)); +wire eu_per_en = eu_mb_en & (eu_mab<(`PER_SIZE>>1)); wire [15:0] per_din = dbg_mem_en ? dbg_mem_dout : eu_mdb_out; wire [1:0] per_we = dbg_mem_en ? dbg_mem_wr : eu_mb_wr;
/trunk/fpga/actel_m1a3pl_dev_kit/rtl/verilog/openmsp430/openMSP430_defines.v
59,6 → 59,7
// Program Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define PMEM_SIZE_CUSTOM
//`define PMEM_SIZE_59_KB
//`define PMEM_SIZE_55_KB
//`define PMEM_SIZE_54_KB
78,6 → 79,7
// Data Memory Size:
// Uncomment the required memory size
//-------------------------------------------------------
//`define DMEM_SIZE_CUSTOM
//`define DMEM_SIZE_32_KB
//`define DMEM_SIZE_24_KB
//`define DMEM_SIZE_16_KB
168,6 → 170,7
// shifted up and a custom linker script will therefore
// be required by the GCC compiler.
//-------------------------------------------------------
//`define PER_SIZE_CUSTOM
//`define PER_SIZE_32_KB
//`define PER_SIZE_16_KB
//`define PER_SIZE_8_KB
233,6 → 236,31
 
 
//-------------------------------------------------------
// Custom Program/Data and Peripheral Memory Spaces
//-------------------------------------------------------
// The following values are valid only if the
// corresponding *_SIZE_CUSTOM defines are uncommented:
//
// - *_SIZE : size of the section in bytes.
// - *_AWIDTH : address port width, this value must allow
// to address all WORDS of the section
// (i.e. the *_SIZE divided by 2)
//-------------------------------------------------------
 
// Custom Program memory (enabled with PMEM_SIZE_CUSTOM)
`define PMEM_CUSTOM_AWIDTH 10
`define PMEM_CUSTOM_SIZE 2048
 
// Custom Data memory (enabled with DMEM_SIZE_CUSTOM)
`define DMEM_CUSTOM_AWIDTH 6
`define DMEM_CUSTOM_SIZE 128
 
// Custom Peripheral memory (enabled with PER_SIZE_CUSTOM)
`define PER_CUSTOM_AWIDTH 8
`define PER_CUSTOM_SIZE 512
 
 
//-------------------------------------------------------
// ASIC version
//-------------------------------------------------------
// When uncommented, this define will enable the
460,6 → 488,10
`define PMEM_AWIDTH 9
`define PMEM_SIZE 1024
`endif
`ifdef PMEM_SIZE_CUSTOM
`define PMEM_AWIDTH `PMEM_CUSTOM_AWIDTH
`define PMEM_SIZE `PMEM_CUSTOM_SIZE
`endif
 
// Data Memory Size
`ifdef DMEM_SIZE_32_KB
514,6 → 546,10
`define DMEM_AWIDTH 6
`define DMEM_SIZE 128
`endif
`ifdef DMEM_SIZE_CUSTOM
`define DMEM_AWIDTH `DMEM_CUSTOM_AWIDTH
`define DMEM_SIZE `DMEM_CUSTOM_SIZE
`endif
 
// Peripheral Memory Size
`ifdef PER_SIZE_32_KB
544,6 → 580,10
`define PER_AWIDTH 8
`define PER_SIZE 512
`endif
`ifdef PER_SIZE_CUSTOM
`define PER_AWIDTH `PER_CUSTOM_AWIDTH
`define PER_SIZE `PER_CUSTOM_SIZE
`endif
 
// Data Memory Base Adresses
`define DMEM_BASE `PER_SIZE
/trunk/fpga/actel_m1a3pl_dev_kit/sim/rtl_sim/bin/msp430sim
116,19 → 116,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
 
# Source the extracted configuration file
source pmem.sh
 
# Create IHEX file from ELF
echo "Convert ELF file to IHEX format..."
msp430-objcopy -O ihex pmem.elf pmem.ihex
/trunk/fpga/actel_m1a3pl_dev_kit/sim/rtl_sim/bin/omsp_config.sh
0,0 → 1,5
#include "../run/pmem.h"
 
pmemsize=PMEM_SIZE
dmemsize=DMEM_SIZE
persize=PER_SIZE
trunk/fpga/actel_m1a3pl_dev_kit/sim/rtl_sim/bin/omsp_config.sh Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property

powered by: WebSVN 2.1.0

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