URL
https://opencores.org/ocsvn/neo430/neo430/trunk
Subversion Repositories neo430
Compare Revisions
- This comparison shows the changes necessary to convert path
/neo430
- from Rev 167 to Rev 168
- ↔ Reverse comparison
Rev 167 → Rev 168
/trunk/rtl/core/neo430_application_image.vhd
File deleted
/trunk/rtl/core/neo430_crc.vhd
File deleted
/trunk/rtl/core/neo430_uart.vhd
File deleted
/trunk/rtl/core/neo430_reg_file.vhd
File deleted
/trunk/rtl/core/neo430_cfu.vhd
File deleted
/trunk/rtl/core/neo430_timer.vhd
File deleted
/trunk/rtl/core/neo430_control.vhd
File deleted
/trunk/rtl/core/neo430_boot_rom.vhd
File deleted
/trunk/rtl/core/neo430_alu.vhd
File deleted
/trunk/rtl/core/neo430_dmem.vhd
File deleted
/trunk/rtl/core/neo430_imem.vhd
File deleted
/trunk/rtl/core/neo430_cpu.vhd
File deleted
/trunk/rtl/core/neo430_wb_interface.vhd
File deleted
/trunk/rtl/core/neo430_package.vhd
File deleted
/trunk/rtl/core/neo430_spi.vhd
File deleted
/trunk/rtl/core/neo430_bootloader_image.vhd
File deleted
/trunk/rtl/core/neo430_gpio.vhd
File deleted
/trunk/rtl/core/neo430_wdt.vhd
File deleted
/trunk/rtl/core/neo430_muldiv.vhd
File deleted
/trunk/rtl/core/neo430_top.vhd
File deleted
/trunk/rtl/core/neo430_addr_gen.vhd
File deleted
/trunk/rtl/core/neo430_twi.vhd
File deleted
/trunk/rtl/core/neo430_pwm.vhd
File deleted
/trunk/rtl/core/neo430_sysconfig.vhd
File deleted
/trunk/rtl/top_templates/neo430_top_std_logic.vhd
File deleted
/trunk/rtl/top_templates/neo430_test.vhd
File deleted
/trunk/rtl/top_templates/README.txt
File deleted
/trunk/rtl/top_templates/neo430_top_axi4lite.vhd
File deleted
/trunk/rtl/top_templates/neo430_top_avm.vhd
File deleted
/trunk/LICENSE
File deleted
/trunk/issue_template.md
File deleted
/trunk/doc/wbspec_b4.pdf
File deleted
/trunk/doc/NEO430.pdf
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
trunk/doc/NEO430.pdf
Property changes :
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/doc/figures/test_setup.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/figures/test_setup.jpg
===================================================================
--- trunk/doc/figures/test_setup.jpg (revision 167)
+++ trunk/doc/figures/test_setup.jpg (nonexistent)
trunk/doc/figures/test_setup.jpg
Property changes :
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/doc/figures/oshw_logo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/figures/oshw_logo.png
===================================================================
--- trunk/doc/figures/oshw_logo.png (revision 167)
+++ trunk/doc/figures/oshw_logo.png (nonexistent)
trunk/doc/figures/oshw_logo.png
Property changes :
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/doc/figures/neo430_arch.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/figures/neo430_arch.png
===================================================================
--- trunk/doc/figures/neo430_arch.png (revision 167)
+++ trunk/doc/figures/neo430_arch.png (nonexistent)
trunk/doc/figures/neo430_arch.png
Property changes :
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/doc/instruction_set.pdf
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: trunk/doc/instruction_set.pdf
===================================================================
--- trunk/doc/instruction_set.pdf (revision 167)
+++ trunk/doc/instruction_set.pdf (nonexistent)
trunk/doc/instruction_set.pdf
Property changes :
Deleted: svn:mime-type
## -1 +0,0 ##
-application/octet-stream
\ No newline at end of property
Index: trunk/sim/ISIM/neo430_tb.wcfg
===================================================================
--- trunk/sim/ISIM/neo430_tb.wcfg (revision 167)
+++ trunk/sim/ISIM/neo430_tb.wcfg (nonexistent)
@@ -1,514 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Global
- label
-
-
- clk_i
- clk_i
-
-
- clk_gen[7:0]
- clk_gen[7:0]
-
-
- rst_i
- rst_i
-
-
- rst_gen[3:0]
- rst_gen[3:0]
- BINARYRADIX
-
-
- ext_rst
- ext_rst
-
-
- sys_rst
- sys_rst
-
-
- CPU - Control
- label
-
-
- irq_i[3:0]
- irq_i[3:0]
-
-
- irq_buf[3:0]
- irq_buf[3:0]
-
-
- irq_ack
- irq_ack
-
-
- irq_start
- irq_start
-
-
- am[3:0]
- am[3:0]
- BINARYRADIX
-
-
- ir[15:0]
- ir[15:0]
-
-
- state
- state
-
-
- ctrl_o[29:0]
- ctrl_o[29:0]
-
-
- CPU - RF
- label
-
-
- sreg[15:0]
- sreg[15:0]
-
-
- reg_file[15:0][15:0]
- reg_file[15:0][15:0]
-
-
- CPU - ALU
- label
-
-
- op_a_ff[15:0]
- op_a_ff[15:0]
- HEXRADIX
-
-
- op_b_ff[15:0]
- op_b_ff[15:0]
- HEXRADIX
-
-
- alu_res[15:0]
- alu_res[15:0]
- HEXRADIX
-
-
- CPU - Address Generator
- label
-
-
- mem_addr_reg[15:0]
- mem_addr_reg[15:0]
-
-
- mem_addr_o[15:0]
- mem_addr_o[15:0]
-
-
- irq_sel_i[1:0]
- irq_sel_i[1:0]
-
-
- imm_i[15:0]
- imm_i[15:0]
-
-
- CPU - BUS Interface
- label
-
-
- io_acc
- io_acc
-
-
- mem_rd_o
- mem_rd_o
-
-
- mem_wr_o[1:0]
- mem_wr_o[1:0]
-
-
- mem_addr_o[15:0]
- mem_addr_o[15:0]
- HEXRADIX
-
-
- mem_data_o[15:0]
- mem_data_o[15:0]
-
-
- mem_data_i[15:0]
- mem_data_i[15:0]
-
-
- Main Memory
- label
-
-
- imem_up_en
- imem_up_en
-
-
- IO: UART
- label
-
-
- uart_txd_o
- uart_txd_o
-
-
- uart_rxd_i
- uart_rxd_i
-
-
- uart_irq_o
- uart_irq_o
-
-
- ctrl[15:0]
- ctrl[15:0]
-
-
- uart_tx_busy
- uart_tx_busy
-
-
- uart_tx_done
- uart_tx_done
-
-
- uart_rx_avail
- uart_rx_avail
-
-
- IO: SPI
- label
-
-
- spi_sclk_o
- spi_sclk_o
-
-
- spi_mosi_o
- spi_mosi_o
-
-
- spi_miso_i
- spi_miso_i
-
-
- spi_cs_o[7:0]
- spi_cs_o[7:0]
-
-
- spi_irq_o
- spi_irq_o
-
-
- ctrl[15:0]
- ctrl[15:0]
-
-
- spi_busy
- spi_busy
-
-
- IO: Timer
- label
-
-
- thres[15:0]
- thres[15:0]
- HEXRADIX
-
-
- irq_o
- irq_o
-
-
- cnt[15:0]
- cnt[15:0]
-
-
- IO: GPIO
- label
-
-
- gpio_o[15:0]
- gpio_o[15:0]
-
-
- gpio_i[15:0]
- gpio_i[15:0]
-
-
- irq_o
- irq_o
-
-
- IO: Watchdog
- label
-
-
- enable
- enable
-
-
- cnt[16:0]
- cnt[16:0]
-
-
- IO: Wishbone Bus Interface
- label
-
-
- enable
- enable
-
-
- pending
- pending
-
-
- wb_adr_o[31:0]
- wb_adr_o[31:0]
-
-
- wb_dat_i[31:0]
- wb_dat_i[31:0]
-
-
- wb_dat_o[31:0]
- wb_dat_o[31:0]
-
-
- wb_we_o
- wb_we_o
-
-
- wb_sel_o[3:0]
- wb_sel_o[3:0]
- BINARYRADIX
-
-
- wb_stb_o
- wb_stb_o
-
-
- wb_cyc_o
- wb_cyc_o
-
-
- wb_ack_i
- wb_ack_i
-
-
- Sysconfig
- label
-
-
- info_addr[2:0]
- info_addr[2:0]
-
-
- rden
- rden
-
-
- acc_en
- acc_en
-
-
- sysinfo_mem[0:7][15:0]
- sysinfo_mem[0:7][15:0]
-
-
- IO: MulDiv
- label
-
-
- rden_i
- rden_i
-
-
- wr_en
- wr_en
-
-
- acc_en
- acc_en
-
-
- opa[15:0]
- opa[15:0]
- SIGNEDDECRADIX
-
-
- opb[15:0]
- opb[15:0]
- SIGNEDDECRADIX
-
-
- resx[15:0]
- resx[15:0]
-
-
- resy[15:0]
- resy[15:0]
-
-
- operation
- operation
-
-
- start
- start
-
-
- run
- run
-
-
- remainder[15:0]
- remainder[15:0]
- SIGNEDDECRADIX
-
-
- quotient[15:0]
- quotient[15:0]
- SIGNEDDECRADIX
-
-
- product[31:0]
- product[31:0]
- SIGNEDDECRADIX
-
-
- IO: CRC
- label
-
-
- wren
- wren
-
-
- idata[7:0]
- idata[7:0]
-
-
- start
- start
-
-
- mode
- mode
-
-
- cnt[2:0]
- cnt[2:0]
-
-
- run
- run
-
-
- crc_bit
- crc_bit
-
-
- poly[31:0]
- poly[31:0]
-
-
- crc_sr[31:0]
- crc_sr[31:0]
-
-
- IO: PWM
- label
-
-
- pwm_o[3:0]
- pwm_o[3:0]
-
-
- pwm_ch[0:3][7:0]
- pwm_ch[0:3][7:0]
-
-
- IO: TWI
- label
-
-
- data_i[15:0]
- data_i[15:0]
-
-
- data_o[15:0]
- data_o[15:0]
-
-
- wr_en
- wr_en
-
-
- rd_en
- rd_en
-
-
- twi_clk
- twi_clk
-
-
- arbiter[2:0]
- arbiter[2:0]
- BINARYRADIX
-
-
- ctrl[7:0]
- ctrl[7:0]
-
-
- twi_bitcnt[3:0]
- twi_bitcnt[3:0]
-
-
- twi_rtx_sreg[8:0]
- twi_rtx_sreg[8:0]
-
-
- twi_sda_io
- twi_sda_io
-
-
- twi_scl_io
- twi_scl_io
-
-
Index: trunk/sim/modelsim/wave.do
===================================================================
--- trunk/sim/modelsim/wave.do (revision 167)
+++ trunk/sim/modelsim/wave.do (nonexistent)
@@ -1,134 +0,0 @@
-onerror {resume}
-quietly WaveActivateNextPane {} 0
-
-add wave -noupdate -divider Global
-add wave -noupdate /neo430_tb/neo430_top_inst/clk_i
-add wave -noupdate /neo430_tb/neo430_top_inst/clk_gen
-add wave -noupdate /neo430_tb/neo430_top_inst/rst_i
-add wave -noupdate /neo430_tb/neo430_top_inst/rst_gen
-add wave -noupdate /neo430_tb/neo430_top_inst/rst_gen_sync
-add wave -noupdate /neo430_tb/neo430_top_inst/ext_rst
-add wave -noupdate /neo430_tb/neo430_top_inst/sys_rst
-
-add wave -noupdate -divider CPUControl
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/ir
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/irq_i
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/irq_buf
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/irq_ack
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/irq_start
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/irq_run
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/irq_ret
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/am
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/state
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_control_inst/ctrl_o
-
-add wave -noupdate -divider CPU_Regfile
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_reg_file_inst/sreg
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_reg_file_inst/reg_file
-
-add wave -noupdate -divider CPU_ALU
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_alu_inst/op_a_ff
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_alu_inst/op_b_ff
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_alu_inst/alu_res
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_addr_gen_inst/mem_addr_reg
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_addr_gen_inst/mem_addr_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_addr_gen_inst/irq_sel_i
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/neo430_addr_gen_inst/imm_i
-
-add wave -noupdate -divider Bus_Interface
-add wave -noupdate /neo430_tb/neo430_top_inst/io_acc
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/mem_rd_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/mem_wr_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/mem_addr_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/mem_data_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_cpu_inst/mem_data_i
-
-add wave -noupdate -divider Main_Memory
-add wave -noupdate /neo430_tb/neo430_top_inst/imem_up_en
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_imem_inst/imem_init_file
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_imem_inst/imem_file_h
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_imem_inst/imem_file_l
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_dmem_inst/dmem_file
-
-add wave -noupdate -divider Bootloader_ROM
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_boot_rom_inst_true/neo430_boot_rom_inst/boot_img
-
-add wave -noupdate -divider IO_UART
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/baud
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/ctrl
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_tx_sreg
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_tx_busy
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_txd_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_rx_busy
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_rx_reg
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_rx_avail
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/uart_rxd_i
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_uart_inst/usart_irq_o
-
-add wave -noupdate -divider IO_SPI
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_spi_inst/spi_busy
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_spi_inst/spi_sclk_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_spi_inst/spi_mosi_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_spi_inst/spi_miso_i
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_spi_inst/spi_cs_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_usart_inst_true/neo430_spi_inst/spi_rtx_sreg
-
-add wave -noupdate -divider IO_Timer
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_timer_inst_true/neo430_timer_inst/tctrl
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_timer_inst_true/neo430_timer_inst/thres
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_timer_inst_true/neo430_timer_inst/tcnt
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_timer_inst_true/neo430_timer_inst/irq_o
-
-add wave -noupdate -divider IO_GPIO
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_gpio_inst_true/neo430_gpio_inst/trigger
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_gpio_inst_true/neo430_gpio_inst/gpio_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_gpio_inst_true/neo430_gpio_inst/gpio_i
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_gpio_inst_true/neo430_gpio_inst/irq_o
-
-add wave -noupdate IO_Watchdog
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/wren
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/enable
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/clk_sel
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/cnt
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/rst_gen
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/rst_sync
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/rst_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wdt_inst_true/neo430_wdt_inst/source
-
-add wave -noupdate -divider IO_Wishbone
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/enable
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/pending
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/pipelined
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/terr
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_adr_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_dat_i
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_dat_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_we_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_sel_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_stb_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_cyc_o
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_wb32_if_inst_true/neo430_wb32_inst/wb_ack_i
-
-add wave -noupdate -divider IO_Sysconfig
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_sysconfig_inst/sysinfo_mem
-add wave -noupdate /neo430_tb/neo430_top_inst/neo430_sysconfig_inst/sysconfig_mem
-
-
-TreeUpdate [SetDefaultTree]
-WaveRestoreCursors {{Cursor 1} {92 ps} 0}
-quietly wave cursor active 1
-configure wave -namecolwidth 150
-configure wave -valuecolwidth 100
-configure wave -justifyvalue left
-configure wave -signalnamewidth 1
-configure wave -snapdistance 10
-configure wave -datasetprefix 0
-configure wave -rowmargin 4
-configure wave -childrowmargin 2
-configure wave -gridoffset 0
-configure wave -gridperiod 1
-configure wave -griddelta 40
-configure wave -timeline 0
-configure wave -timelineunits ps
-update
-WaveRestoreZoom {0 ps} {1 ns}
Index: trunk/sim/modelsim/simulate.do
===================================================================
--- trunk/sim/modelsim/simulate.do (revision 167)
+++ trunk/sim/modelsim/simulate.do (nonexistent)
@@ -1,44 +0,0 @@
-puts {NEO430 Modelsim Simulation Script}
-
--- set up sources --
-set sim_src ".."
-set rtl_src "../../rtl/core"
-
-quit -sim
-
--- compile sources --
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_package.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_addr_gen.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_alu.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_application_image.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_bootloader_image.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_boot_rom.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_cfu.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_control.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_cpu.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_crc.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_dmem.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_gpio.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_imem.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_muldiv.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_pwm.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_reg_file.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_sysconfig.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_timer.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_uart.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_spi.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_wb_interface.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_wdt.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_twi.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${rtl_src}/neo430_top.vhd
-vcom -work neo430 -2002 -explicit -nocasestaticerror ${sim_src}/neo430_tb.vhd
-
--- start simulation --
-vsim -t 1ps neo430.neo430_tb
-
--- waveform configuration --
-do ${sim_src}/modelsim/wave.do
-
--- run --
-run 200 us
-
Index: trunk/sim/neo430_tb.vhd
===================================================================
--- trunk/sim/neo430_tb.vhd (revision 167)
+++ trunk/sim/neo430_tb.vhd (nonexistent)
@@ -1,224 +0,0 @@
--- #################################################################################################
--- # << NEO430 - Simple testbench >> #
--- # ********************************************************************************************* #
--- # This simple testbench instantiates the top entity of the NEO430 processors, generates clock #
--- # and reset signals and outputs data send via the processor's UART to the simulator console. #
--- # ********************************************************************************************* #
--- # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
--- # Copyright by Stephan Nolting: stnolting@gmail.com #
--- # #
--- # This source file may be used and distributed without restriction provided that this copyright #
--- # statement is not removed from the file and that any derivative work contains the original #
--- # copyright notice and the associated disclaimer. #
--- # #
--- # This source file is free software; you can redistribute it and/or modify it under the terms #
--- # of the GNU Lesser General Public License as published by the Free Software Foundation, #
--- # either version 3 of the License, or (at your option) any later version. #
--- # #
--- # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
--- # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
--- # See the GNU Lesser General Public License for more details. #
--- # #
--- # You should have received a copy of the GNU Lesser General Public License along with this #
--- # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
--- # ********************************************************************************************* #
--- # Stephan Nolting, Hanover, Germany 23.09.2019 #
--- #################################################################################################
-
-library ieee;
-use ieee.std_logic_1164.all;
-use ieee.numeric_std.all;
-use ieee.math_real.all;
-
-library neo430;
-use neo430.neo430_package.all;
-use std.textio.all;
-
-entity neo430_tb is
-end neo430_tb;
-
-architecture neo430_tb_rtl of neo430_tb is
-
- -- User Configuration ---------------------------------------------------------------------
- -- -------------------------------------------------------------------------------------------
- constant t_clock_c : time := 10 ns; -- main clock period
- constant f_clock_c : real := 100000000.0; -- main clock in Hz
- constant baud_rate_c : real := 19200.0; -- standard UART baudrate
- -- -------------------------------------------------------------------------------------------
-
- -- internal configuration --
- constant baud_val_c : real := f_clock_c / baud_rate_c;
- constant f_clk_c : natural := natural(f_clock_c);
-
- -- reduced ASCII table --
- type ascii_t is array (0 to 94) of character;
- constant ascii_lut : ascii_t := (' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-',
- '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', '@', 'A',
- 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
- 'V', 'W', 'X', 'Y', 'Z', '[', '\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
- 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~');
-
- -- generators --
- signal clk_gen, rst_gen : std_ulogic := '0';
- signal irq, irq_ack : std_ulogic;
-
- -- local signals --
- signal uart_txd : std_ulogic;
- signal spi_data : std_ulogic;
-
- -- simulation uart receiver --
- signal uart_rx_sync : std_ulogic_vector(04 downto 0) := (others => '1');
- signal uart_rx_busy : std_ulogic := '0';
- signal uart_rx_sreg : std_ulogic_vector(08 downto 0) := (others => '0');
- signal uart_rx_baud_cnt : real;
- signal uart_rx_bitcnt : natural;
-
- -- twi --
- signal twi_sda : std_logic;
- signal twi_scl : std_logic;
-
-begin
-
- -- Clock/Reset Generator ----------------------------------------------------
- -- -----------------------------------------------------------------------------
- clk_gen <= not clk_gen after (t_clock_c/2);
- rst_gen <= '0', '1' after 60*(t_clock_c/2);
-
-
- -- CPU Core -----------------------------------------------------------------
- -- -----------------------------------------------------------------------------
- neo430_top_inst: neo430_top
- generic map (
- -- general configuration --
- CLOCK_SPEED => f_clk_c, -- main clock in Hz
- IMEM_SIZE => 4*1024, -- internal IMEM size in bytes, max 48kB (default=4kB)
- DMEM_SIZE => 2*1024, -- internal DMEM size in bytes, max 12kB (default=2kB)
- -- additional configuration --
- USER_CODE => x"4788", -- custom user code
- -- module configuration --
- DADD_USE => true, -- implement DADD instruction? (default=true)
- MULDIV_USE => true, -- implement multiplier/divider unit? (default=true)
- WB32_USE => true, -- implement WB32 unit? (default=true)
- WDT_USE => true, -- implement WBT? (default=true)
- GPIO_USE => true, -- implement GPIO unit? (default=true)
- TIMER_USE => true, -- implement timer? (default=true)
- UART_USE => true, -- implement UART? (default=true)
- CRC_USE => true, -- implement CRC unit? (default=true)
- CFU_USE => true, -- implement custom functions unit? (default=false)
- PWM_USE => true, -- implement PWM controller? (default=true)
- TWI_USE => true, -- implement two wire serial interface? (default=true)
- SPI_USE => true, -- implement SPI? (default=true)
- -- boot configuration --
- BOOTLD_USE => false, -- implement and use bootloader? (default=true)
- IMEM_AS_ROM => false -- implement IMEM as read-only memory? (default=false)
- )
- port map (
- -- global control --
- clk_i => clk_gen, -- global clock, rising edge
- rst_i => rst_gen, -- global reset, async, low-active
- -- gpio --
- gpio_o => open, -- parallel output
- gpio_i => x"0000", -- parallel input
- -- pwm channels --
- pwm_o => open, -- pwm channels
- -- serial com --
- uart_txd_o => uart_txd, -- UART send data
- uart_rxd_i => '0', -- UART receive data
- spi_sclk_o => open, -- serial clock line
- spi_mosi_o => spi_data, -- serial data line out
- spi_miso_i => spi_data, -- serial data line in
- spi_cs_o => open, -- SPI CS 0..5
- twi_sda_io => twi_sda, -- twi serial data line
- twi_scl_io => twi_scl, -- twi serial clock line
- -- 32-bit wishbone interface --
- wb_adr_o => open, -- address
- wb_dat_i => x"00000000", -- read data
- wb_dat_o => open, -- write data
- wb_we_o => open, -- read/write
- wb_sel_o => open, -- byte enable
- wb_stb_o => open, -- strobe
- wb_cyc_o => open, -- valid cycle
- wb_ack_i => '0', -- transfer acknowledge
- -- external interrupt --
- irq_i => irq, -- external interrupt request line
- irq_ack_o => irq_ack -- external interrupt request acknowledge
- );
-
- -- twi pull-ups --
- twi_sda <= 'H';
- twi_scl <= 'H';
-
-
- -- Interrupt Generator ------------------------------------------------------
- -- -----------------------------------------------------------------------------
- interrupt_gen: process
- begin
- irq <= '0';
- wait for 20 ms;
- wait until rising_edge(clk_gen);
- irq <= '1';
- wait for t_clock_c;
- wait until rising_edge(irq_ack);
- irq <= '0';
- wait;
- end process interrupt_gen;
-
-
- -- Console UART Receiver ----------------------------------------------------
- -- -----------------------------------------------------------------------------
- uart_rx_unit: process(clk_gen)
- variable i, j : integer;
- file uart_rx_file : text open write_mode is "uart_rx_dump.txt";
- variable line_tmp : line;
- begin
- if rising_edge(clk_gen) then
- -- synchronizer --
- uart_rx_sync <= uart_rx_sync(3 downto 0) & uart_txd;
- -- arbiter --
- if (uart_rx_busy = '0') then -- idle
- uart_rx_busy <= '0';
- uart_rx_baud_cnt <= round(0.5 * baud_val_c);
- uart_rx_bitcnt <= 9;
- if (uart_rx_sync(4 downto 1) = "1100") then -- start bit? (falling edge)
- uart_rx_busy <= '1';
- end if;
- else
- if (uart_rx_baud_cnt = 0.0) then
- -- adapt to the inter-frame pause - which is not implemented in the neo430 uart ;)
- if (uart_rx_bitcnt = 1) then
- uart_rx_baud_cnt <= round(0.5 * baud_val_c);
- else
- uart_rx_baud_cnt <= round(baud_val_c);
- end if;
- if (uart_rx_bitcnt = 0) then
- uart_rx_busy <= '0'; -- done
- i := to_integer(unsigned(uart_rx_sreg(8 downto 1)));
- j := i - 32;
- if (j < 0) or (j > 95) then
- j := 0; -- undefined = SPACE
- end if;
-
- if (i < 32) or (j > 32+95) then
- report "UART TX: (" & integer'image(i) & ")"; -- print code
- else
- report "UART TX: " & ascii_lut(j); -- print ASCII
- end if;
-
- if (i = 10) then -- Linux line break
- writeline(uart_rx_file, line_tmp);
- elsif (i /= 13) then -- Remove additional carriage return
- write(line_tmp, ascii_lut(j));
- end if;
- else
- uart_rx_sreg <= uart_rx_sync(4) & uart_rx_sreg(8 downto 1);
- uart_rx_bitcnt <= uart_rx_bitcnt - 1;
- end if;
- else
- uart_rx_baud_cnt <= uart_rx_baud_cnt - 1.0;
- end if;
- end if;
- end if;
- end process uart_rx_unit;
-
-
-end neo430_tb_rtl;
Index: trunk/README.md
===================================================================
--- trunk/README.md (revision 167)
+++ trunk/README.md (nonexistent)
@@ -1,167 +0,0 @@
-## Introduction
-
-Welcome to the __NEO430 Processor__ project!
-
-You need a small but still powerful, customizable and microcontroller-like
-processor system for your next FPGA design? Then the NEO430 is the perfect
-choice for you!
-
-This processor is based on the Texas Instruments MSP430(TM) ISA and provides 100%
-compatibility with the original instruction set. The NEO430 is not an MSP430
-clone – it is more a complete new implementation from the bottom up. The
-processor features a very small outline, already implementing standard
-features like a timer, a watchdog, UART, TWI and SPI serial interfaces, general
-purpose IO ports, an internal bootloader and of course internal memory for
-program code and data. All of the peripheral modules are optional – so if you
-do not need them, you can exclude them from implementation to reduce the size
-of the system. Any additional modules, which make a more customized system,
-can be connected via a Wishbone-compatible bus interface. By this, you can
-built a system, that perfectly fits your needs.
-
-It is up to you to use the NEO430 as stand-alone, configurable and extensible
-microcontroller, or to include it as controller within a more complex SoC
-design.
-
-The high-level software development is based on the free TI msp430-gcc
-compiler tool chain. You can either use Windows or Linux as build
-environment for your applications – the project comes with build scripts
-for both worlds. The sw\example folder of this project features several demo
-programs from which you can start creating your own NEO430 applications.
-
-This project is intended to work "out of the box". Just synthesize the test
-setup from this project, upload it to your FPGA board of choice (the NEO430 uses
-a vendor-independent VHDL description) and start exploring the capabilities of
-the NEO430 processor. Application program generation (and installation) works
-by executing a single "make" command. Jump to the "Let’s Get It Started"
-chapter, which provides a lot of guides and tutorials to make your first
-NEO430 setup run:
-https://github.com/stnolting/neo430/blob/master/doc/NEO430.pdf
-
-
-## Processor Features
-
-
-(optional modules are marked using dashed lines in the figure above)
-
-
-- 16-bit open source soft-core microcontroller-like processor system
-- Code-efficient CISC-like instruction capabilities
-- Full support of the original MSP430 instruction set architecture
-- Tool chain based on free TI msp430-gcc compiler
-- Application compilation scripts for Windows Powershell / Windows Subsystem for Linux / native Linux
-- Completely described in behavioral, platform-independent VHDL
-- Fully synchronous design, no latches, no gated clocks
-- Very small outline and high operating frequency
-- Internal DMEN (RAM, for data) and IMEM (RAM or ROM, for code), configurable sizes
-- One external interrupt line
-- Customizable processor hardware configuration:
- - Optional multiplier/divider unit (MULDIV)
- - Optional high-precision timer (TIMER)
- - Optional universal asynchronous receiver and transmitter (UART)
- - Optional serial peripheral interface (SPI)
- - Optional two wire serial interface (TWI)
- - Optional general purpose parallel IO port (GPIO), 16 inputs, 16 outputs, with pin-change interrupt
- - Optional 32-bit Wishbone bus interface adapter (WB32) - including bridges to Avalon(TM) bus and AXI4-Lite(TM)
- - Optional watchdog timer (WDT)
- - Optional cyclic redundancy check unit (CRC16/32)
- - Optional custom functions unit (CFU) for user-defined processor extensions
- - Optional 4 channel PWM controller with 1 to 8 bit resolution (PWM)
- - Optional internal bootloader (2kB ROM) with serial user console and automatic boot from external SPI EEPROM
-
-
-## Differences to TI's Original MSP430(TM) Processors
-
-- Completely different processor modules with different functionality
-- Up to 48kB instruction memory and 12kB data memory
-- Specific memory map – provided NEO430 linker script and compilation script required
-- Custom binary executable format
-- Just 4 CPU interrupt channels
-- Single clock domain for complete processor
-- Different numbers of instruction execution cycles
-- Only one power-down (sleep) mode
-- Wishbone-compatible interface to attach custom IP
-- Internal bootloader with text interface (via UART serial port)
-
-
-## Implementation Results
-
-Mapping results generated for HW version 0x0300. The full (default) configuration includes
-all optional processor modules (excluding the CFU), an IMEM size of 4kB and a DMEM size of 2kB.
-Results generated with Xilinx Vivado 2017.3, Intel Quartus Prime Lite 17.1 and Lattice Radiant 1.0 (Synplify)
-
-| __Xilinx Artix-7 (XC7A35TICSG324-1L)__ | LUTs | FFs | BRAMs | DSPs | f_max* |
-|:----------------------------------------|:---------:|:--------:|:--------:|:------:|:-------:|
-| Full (default) configuration: | 1006 (5%) | 952 (2%) | 2.5 (5%) | 0 (0%) | 100 MHz |
-| Minimal configuration (CPU + GPIO): | 879 (4%) | 287 (1%) | 1 (2%) | 0 (0%) | 100 MHz |
-
-| __Intel/Altera Cyclone IV (EP4CE22F17C6)__ | LUTs | FFs | Memory bits | DSPs | f_max |
-|:--------------------------------------------|:---------:|:--------:|:------------:|:------:|:-------:|
-| Full (default) configuration: | 1676 (8%) | 940 (4%) | 65792 (11%) | 0 (0%) | 116 MHz |
-| Minimal configuration (CPU + GPIO): | 602 (3%) | 228 (1%) | 49408 (8%) | 0 (0%) | 124 MHz |
-
-| __Lattice iCE40 UltraPlus (iCE40UP5K-SG48I)__ | LUTs | FFs | EBRs | DSPs | SRAMs | f_max* |
-|:-----------------------------------------------|:----------:|:----------:|:--------:|:------:|:------:|:------:|
-| Full (default) configuration: | 2843 (54%) | 1153 (22%) | 16 (53%) | 0 (0%) | 0 (0%) | 20 MHz |
-| Minimal configuration (CPU + GPIO): | 1470 (28%) | 493 (9%) | 12 (40%) | 0 (0%) | 0 (0%) | 20 MHz |
-
-*) Constrained
-
-
-## Let's Get It Started!
-
- * At first, make sure to get the most recent version of this project from GitHub:
-
- ~~~
- git clone https://github.com/stnolting/neo430.git
- ~~~
-
- * Next, install the compiler toolchain from the TI homepage (select the "compiler only" package):
-
- http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/index_FDS.html
-
- * Follow the instructions from the "Let's Get It Started" section of the NEO430 documentary:
-
- https://github.com/stnolting/neo430/blob/master/doc/NEO430.pdf
-
- * The NEO430 documentary will guide you to create a simple test setup, which serves as "hello world" FPGA demo:
-
-
-
- * This project also includes some example programs, from which you can start:
-
- https://github.com/stnolting/neo430/tree/master/sw/example
-
- * Have fun! =)
-
-
-## Questions?
-
-If you have any questions, bug reports, ideas or if you are facing problems with the NEO430, feel free to drop me a line:
-
- stnolting@gmail.com
-
-
-## Citation
-
-If you are using the NEO430 for some kind of publication, please cite it as follows:
-
-> S. Nolting, "The NEO430 Processor", github.com/stnolting/neo430
-
-
-## Proprietary/Legal Notice
-
-"MSP430" is a trademark of Texas Instruments Corporation.
-
-"Windows" is a trademark of Microsoft Corporation.
-
-"Virtex", "Artix", "ISE" and "Vivado" are trademarks of Xilinx Inc.
-
-"Cyclone", "Quartus" and "Avalon Bus" are trademarks of Intel Corporation.
-
-"iCE40 UltraPlus" and "Lattice Radiant" are trademarks of Lattice Semiconductor Corporation.
-
-"AXI", "AXI4" and "AXI4-Lite" are trademarks of Arm Holdings plc.
-
-
-
-
Index: trunk/sw/tools/image_gen/main.cpp
===================================================================
--- trunk/sw/tools/image_gen/main.cpp (revision 167)
+++ trunk/sw/tools/image_gen/main.cpp (nonexistent)
@@ -1,203 +0,0 @@
-// #################################################################################################
-// # < NEO430 Boot image generator > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.10.2017 #
-// #################################################################################################
-
-#include
-#include
-#include
-#include
-
-int main(int argc, char *argv[]) {
-
- if (argc != 4) {
- printf("<<< NEO430 executable image generator >>>\n"
- "Three arguments are required.\n"
- "1st: Option\n"
- " -app_bin : Generate application executable binary (with header!) \n"
- " -app_img : Generate application raw executable memory image (text file, no header!)\n"
- " -bld_img : Generate bootloader raw executable memory image (text file, no header!)\n"
- "2nd: Input file (raw binary image)\n"
- "3rd: Output file (as selected)\n");
- return 1;
- }
-
- FILE *input, *output;
- unsigned char buffer[2];
- char tmp_string[512];
- uint16_t tmp = 0, size = 0, checksum = 0;
- int i = 0;
- int option = 0;
-
- if (strcmp(argv[1], "-app_bin") == 0)
- option = 1;
- else if (strcmp(argv[1], "-app_img") == 0)
- option = 2;
- else if (strcmp(argv[1], "-bld_img") == 0)
- option = 3;
- else {
- printf("Invalid option!");
- return 2;
- }
-
- // open input file
- input = fopen(argv[2], "rb");
- if(input == NULL){
- printf("Input file error!");
- return 3;
- }
-
- // open output file
- output = fopen(argv[3], "wb");
- if(output == NULL){
- printf("Output file error!");
- return 4;
- }
-
-
-// ------------------------------------------------------------
-// Generate BINARY executable (with header!!!)
-// ------------------------------------------------------------
- if (option == 1) {
- // reserve space for header
- fputc(char(0), output);
- fputc(char(0), output);
- fputc(char(0), output);
- fputc(char(0), output);
- fputc(char(0), output);
- fputc(char(0), output);
-
- buffer[0] = 0;
- buffer[1] = 0;
-
- checksum = 0;
- size = 0;
- rewind(input);
- while(fread(&buffer, sizeof(unsigned char), 2, input) != 0) {
- tmp = (((uint16_t)buffer[1] << 8) | buffer[0]);
- checksum = checksum ^ tmp;
- fputc(buffer[1], output);
- fputc(buffer[0], output);
- size += 2;
- }
-
- // build header
- rewind(output);
- fputc((unsigned char)(0xCA), output);
- fputc((unsigned char)(0xFE), output);
- fputc((unsigned char)((size & 0xFF00) >> 8), output);
- fputc((unsigned char)((size & 0x00FF) >> 0), output);
- fputc((unsigned char)((checksum & 0xFF00) >> 8), output);
- fputc((unsigned char)((checksum & 0x00FF) >> 0), output);
- }
-
-
-// ------------------------------------------------------------
-// Generate APPLICATION's executable memory init file (no header!!!)
-// ------------------------------------------------------------
- if (option == 2) {
-
- // header
- sprintf(tmp_string, "-- The NEO430 Processor Project, by Stephan Nolting\r\n"
- "-- Auto-generated memory init file (for APPLICATION)\r\n"
- "\r\n"
- "library ieee;\r\n"
- "use ieee.std_logic_1164.all;\r\n"
- "\r\n"
- "package neo430_application_image is\r\n"
- "\r\n"
- " type application_init_image_t is array (0 to 65535) of std_ulogic_vector(15 downto 0);\r\n"
- " constant application_init_image : application_init_image_t := (\r\n");
- fputs(tmp_string, output);
-
- // data
- buffer[0] = 0;
- buffer[1] = 0;
- i = 0;
- while(fread(&buffer, sizeof(unsigned char), 2, input) != 0) {
- tmp = (((uint16_t)buffer[1] << 8) | buffer[0]);
- sprintf(tmp_string, " %06d => x\"%04x\",\r\n", i, tmp);
- fputs(tmp_string, output);
- buffer[0] = 0;
- buffer[1] = 0;
- i++;
- }
-
- sprintf(tmp_string, " others => x\"0000\"\r\n");
- fputs(tmp_string, output);
-
- // end
- sprintf(tmp_string, " );\r\n"
- "\r\n"
- "end neo430_application_image;\r\n");
- fputs(tmp_string, output);
- }
-
-
-// ------------------------------------------------------------
-// Generate BOOTLOADER's executable memory init file (no header!!!)
-// ------------------------------------------------------------
- if (option == 3) {
-
- // header
- sprintf(tmp_string, "-- The NEO430 Processor Project, by Stephan Nolting\r\n"
- "-- Auto-generated memory init file (for BOOTLOADER)\r\n"
- "\r\n"
- "library ieee;\r\n"
- "use ieee.std_logic_1164.all;\r\n"
- "\r\n"
- "package neo430_bootloader_image is\r\n"
- "\r\n"
- " type bootloader_init_image_t is array (0 to 65535) of std_ulogic_vector(15 downto 0);\r\n"
- " constant bootloader_init_image : bootloader_init_image_t := (\r\n");
- fputs(tmp_string, output);
-
- // data
- buffer[0] = 0;
- buffer[1] = 0;
- i = 0;
- while(fread(&buffer, sizeof(unsigned char), 2, input) != 0) {
- tmp = (((uint16_t)buffer[1] << 8) | buffer[0]);
- sprintf(tmp_string, " %06d => x\"%04x\",\r\n", i, tmp);
- fputs(tmp_string, output);
- buffer[0] = 0;
- buffer[1] = 0;
- i++;
- }
-
- sprintf(tmp_string, " others => x\"0000\"\r\n");
- fputs(tmp_string, output);
-
- // end
- sprintf(tmp_string, " );\r\n"
- "\r\n"
- "end neo430_bootloader_image;\r\n");
- fputs(tmp_string, output);
- }
-
-
- fclose(input);
- fclose(output);
-
- return 0;
-}
-
Index: trunk/sw/lib/neo430/source/neo430_crc.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_crc.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_crc.c (nonexistent)
@@ -1,136 +0,0 @@
-// #################################################################################################
-// # < neo430_crc.h - CRC module helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.03.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_crc.h"
-
-
-/* ------------------------------------------------------------
- * INFO Compute CRC16 from buffer
- * PARAM start_val: Start value for CRC shift register
- * PARAM polynomial: 16-bit polynomial XOR mask
- * PARAM data: Pointer to BYTE input data array
- * PARAM length: Number of elements in input data array
- * RETURN CRC16 result
- * ------------------------------------------------------------ */
-uint16_t neo430_crc16(uint16_t start_val, uint16_t polynomial, uint8_t *data, uint16_t length) {
-
- CRC_POLY_LO = polynomial;
- CRC_RESX = start_val;
-
- while(length) {
- CRC_CRC16IN = (uint16_t)(*data++); // no wait required here
- length--;
- }
-
- return CRC_RESX;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Compute CRC32 from buffer
- * PARAM start_val: Start value for CRC shift register
- * PARAM polynomial: 32-bit polynomial XOR mask
- * PARAM data: Pointer to BYTE input data array
- * PARAM length: Number of elements in input data array
- * RETURN CRC32 result
- * ------------------------------------------------------------ */
-uint32_t neo430_crc32(uint32_t start_val, uint32_t polynomial, uint8_t *data, uint16_t length) {
-
- CRC_POLY32bit = polynomial;
- CRC_R32bit = start_val;
-
- while(length) {
- CRC_CRC32IN = (uint16_t)(*data++); // no wait required here
- length--;
- }
-
- return CRC_R32bit;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Initialize start value for CRC16
- * PARAM 16-bit CRC shift reg start value
- * ------------------------------------------------------------ */
-void neo430_crc16_set_start_value(uint16_t start_val) {
-
- CRC_RESX = start_val;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Initialize start value for CRC32
- * PARAM 32-bit CRC shift reg start value
- * ------------------------------------------------------------ */
-void neo430_crc32_set_start_value(uint32_t start_val) {
-
- CRC_R32bit = start_val;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Set polynomial mask for CRC16
- * PARAM 16-bit CRC16 polynomial XOR mask
- * ------------------------------------------------------------ */
-void neo430_crc16_set_polynomial(uint16_t poly) {
-
- CRC_POLY_LO = poly;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Set polynomial mask for CRC32
- * PARAM 32-bit CRC16 polynomial XOR mask
- * ------------------------------------------------------------ */
-void neo430_crc32_set_polynomial(uint32_t poly) {
-
- CRC_POLY32bit = poly;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Compute CRC16 for one new data byte
- * PARAM 8-bit data input
- * RETURN Current result of CRC16 shift reg
- * ------------------------------------------------------------ */
-uint16_t neo430_crc16_iterate(uint8_t data) {
-
- CRC_CRC16IN = (uint16_t)data;
- asm volatile ("nop");
- return CRC_RESX;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Compute CRC32 for one new data byte
- * PARAM 8-bit data input
- * RETURN Current result of CRC32 shift reg
- * ------------------------------------------------------------ */
-uint32_t neo430_crc32_iterate(uint8_t data) {
-
- CRC_CRC32IN = (uint16_t)data;
- asm volatile ("nop");
- return CRC_R32bit;
-}
Index: trunk/sw/lib/neo430/source/neo430_cpu.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_cpu.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_cpu.c (nonexistent)
@@ -1,285 +0,0 @@
-// #################################################################################################
-// # < neo430_cpu.h - CPU helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.03.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_cpu.h"
-
-
-/* ------------------------------------------------------------
- * INFO Enable global interrupt flag
- * ------------------------------------------------------------ */
-void neo430_eint(void){
-
- asm volatile ("eint");
- asm volatile ("nop");
-}
-
-
-/* ------------------------------------------------------------
- * INFO Disable global interrupt flag
- * ------------------------------------------------------------ */
-void neo430_dint(void){
-
- asm volatile ("dint");
- asm volatile ("nop");
-}
-
-
-/* ------------------------------------------------------------
- * INFO Read stack pointer (for debugging only)
- * RETURN current stack pointer
- * ------------------------------------------------------------ */
-uint16_t neo430_get_sp(void){
-
- register uint16_t d;
- asm volatile ("mov r1, %0" : "=r" (d));
- uint16_t r = d;
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Read status register
- * RETURN current status register
- * ------------------------------------------------------------ */
-uint16_t neo430_get_sreg(void){
-
- register uint16_t d;
- asm volatile ("mov r2, %0" : "=r" (d));
- uint16_t r = d;
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Set status register
- * PARAM d new value for status register
- * ------------------------------------------------------------ */
-void neo430_set_sreg(uint16_t d){
-
- register uint16_t r = d;
- asm volatile ("mov %0, r2" : : "r" (r));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Set CPU to sleep mode
- * ------------------------------------------------------------ */
-void neo430_sleep(void){
-
- asm volatile ("bis %0, r2" : : "i" (1< microseconds (not very precise!)
- * PARAM ms time in microseconds to wait
- * ------------------------------------------------------------ */
-void neo430_cpu_delay_ms(uint16_t ms) {
-
- // empirical ;)
- uint32_t a = ((uint32_t)CLOCKSPEED_HI) << 1;
- register uint32_t cnt = a * (uint32_t)ms;
-
- while(cnt--) {
- asm volatile ("nop");
- }
-}
-
-
-/* ------------------------------------------------------------
- * INFO Perform a soft reset by jumping to beginning of IMEM
- * ------------------------------------------------------------ */
-void neo430_soft_reset(void) {
-
- asm volatile ("mov #0x0000, r0");
-}
-
-
-/* ------------------------------------------------------------
- * INFO Jump to address
- * PARAM Destination address
- * ------------------------------------------------------------ */
-void neo430_jump_address(uint16_t addr) {
-
- register uint16_t r = addr;
- asm volatile ("mov %0, r0" : : "r" (r));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Call address and save return address to stack
- * PARAM Destination address
- * ------------------------------------------------------------ */
-void neo430_call_address(uint16_t addr) {
-
- register uint16_t r = addr;
- asm volatile ("call %0" : : "r" (r));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Perform byte swap of 16-bit word (e.g., for endianness conversion)
- * PARAM 16-bit input word
- * RETURN 16-bit word with swapped bytes
- * ------------------------------------------------------------ */
-uint16_t neo430_bswap(uint16_t a) {
-
- register uint16_t r = a;
- asm volatile ("swpb %0, %1" : "=r" (r) : "r" (r));
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Combine two bytes into one word
- * PARAM hi will be put in result's high byte
- * PARAM lo will be put in result's low byte
- * RETURN 16-bit combined word
- * ------------------------------------------------------------ */
-uint16_t neo430_combine_bytes(uint8_t hi, uint8_t lo) {
-
- register uint16_t r = neo430_bswap((uint16_t)hi);
- return r | (uint16_t)lo;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Binary-coded decimal addition
- * WARNING Make sure the DADD unit is syntheszied!!!!
- * PARAM 2x 16-bit BCD operands (4 digits)
- * RETURN 16-bit BCD result (4 digits)
- * ------------------------------------------------------------ */
-uint16_t neo430_dadd(uint16_t a, uint16_t b) {
-
- register uint16_t z = a;
- asm volatile ("clrc");
- asm volatile ("dadd %[b], %[z]" : [z] "=r" (z) : "[z]" (z), [b] "r" (b));
- return z;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Memory initialization (byte-wise)
- * PARAM dst: Byte-pointer to beginning of target memory space
- * PARAM data: Init data
- * PARAM num: Number of bytes to initialize
- * ------------------------------------------------------------ */
-void neo430_memset(uint8_t *dst, uint8_t data, uint16_t num) {
-
- while (num--)
- *dst++ = data;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Compare memory to memory
- * PARAM dst: Pointer to beginning of first memory space
- * PARAM src: Pointer to beginning of second memory space
- * PARAM num: Number of bytes to compare
- * RETURN 0 if src == dst
- * ------------------------------------------------------------ */
-uint8_t neo430_memcmp(uint8_t *dst, uint8_t *src, uint16_t num) {
-
- while (num--) {
- if (*dst++ != *src++)
- return 1;
- }
- return 0;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Copy memory space SRC to DST (byte by byte)
- * PARAM dst: Pointer to beginning destination memory space
- * PARAM src: Pointer to beginning source memory space
- * PARAM num: Number of bytes to copy
- * ------------------------------------------------------------ */
-void neo430_memcpy(uint8_t *dst, uint8_t *src, uint16_t num) {
-
- while (num--)
- *dst++ = *src++;
-}
-
-
-/* ------------------------------------------------------------
- * INFO 16-bit bit reversal
- * PARAM input operand to be reversed
- * RETURN reversed bit pattern
- * ------------------------------------------------------------ */
-uint16_t neo430_bit_rev16(uint16_t x) {
-
- register uint16_t z = x;
- register uint16_t y = 0;
- uint8_t i = 0;
-
- for (i=0; i<8; i++) { // two-times unrolled
- asm volatile ("rrc %[a], %[b]" : [b] "=r" (z) : "[b]" (z), [a] "r" (z));
- asm volatile ("rlc %[c], %[d]" : [d] "=r" (y) : "[d]" (y), [c] "r" (y));
-
- asm volatile ("rrc %[a], %[b]" : [b] "=r" (z) : "[b]" (z), [a] "r" (z));
- asm volatile ("rlc %[c], %[d]" : [d] "=r" (y) : "[d]" (y), [c] "r" (y));
- }
- return y;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Pseudo-random number generator
- * RETURN 32-bit random data
- * ------------------------------------------------------------ */
-uint32_t neo430_xorshift32(void) {
-
- static uint32_t x32 = 314159265;
-
- x32 ^= x32 << 13;
- x32 ^= x32 >> 17;
- x32 ^= x32 << 5;
-
- return x32;
-}
Index: trunk/sw/lib/neo430/source/neo430_uart.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_uart.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_uart.c (nonexistent)
@@ -1,434 +0,0 @@
-// #################################################################################################
-// # < neo430_usart.h - Internal UARt driver functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 20.04.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_uart.h"
-
-
-/* ------------------------------------------------------------
- * INFO Reset UART, set the Baud rate of UART transceiver
- * INFO UART_BAUD reg (8 bit) = f_main/(prsc*desired_BAUDRATE)
- * INFO PRSC (Baud register bits 10..8):
- * 0: CLK/2
- * 1: CLK/4
- * 2: CLK/8
- * 3: CLK/64
- * 4: CLK/128
- * 5: CLK/1024
- * 6: CLK/2048
- * 7: CLK/4096
- * PARAM actual baudrate to be used
- * ------------------------------------------------------------ */
-void neo430_uart_setup(uint32_t baudrate){
-
- // raw baud rate prescaler
- uint32_t clock = CLOCKSPEED_32bit;
- uint16_t i = 0; // BAUD rate divisor
- uint8_t p = 0; // prsc = CLK/2
- while (clock >= 2*baudrate) {
- clock -= 2*baudrate;
- i++;
- }
-
- // find clock prsc
- while (i >= 256) {
- if ((p == 2) || (p == 4))
- i >>= 3;
- else
- i >>= 1;
- p++;
- }
-
- UART_CT = 0;
- UART_CT = (1<
- * INFO This is the base for a non-blocking read access
- * RETURN received char
- * ------------------------------------------------------------ */
-char neo430_uart_char_read(void){
-
- return (char)UART_RTX;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print zero-terminated string of chars via internal UART
- * PARAM *s pointer to source string
- * ------------------------------------------------------------ */
-void neo430_uart_print(char *s){
-
- char c = 0;
- while ((c = *s++))
- neo430_uart_putc(c);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print zero-terminated string of chars via internal UART
- * Prints true line break "\r\n" for every '\n'
- * PARAM *s pointer to source string
- * ------------------------------------------------------------ */
-void neo430_uart_br_print(char *s){
-
- char c = 0;
- while ((c = *s++)) {
- if (c == '\n')
- neo430_uart_putc('\r');
- neo430_uart_putc(c);
- }
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get string via UART, string is automatically zero-terminated.
- * Input is acknowledged by ENTER, local echo, chars can be deleted using BACKSPACE.
- * PARAM buffer to store string to
- * PARAM size of buffer (=max string length incl. zero-termination)
- * PARAM activate local echo when =! 0
- * RETURN Length of string (without zero-termination character)
- * ------------------------------------------------------------ */
-uint16_t neo430_uart_scan(char *buffer, uint16_t max_size, uint16_t echo) {
-
- char c = 0;
- uint16_t length = 0;
-
- while (1) {
- c = neo430_uart_getc();
- if (c == '\b') { // BACKSPACE
- if (length != 0) {
- if (echo) {
- neo430_uart_print("\b \b"); // delete last char in console
- }
- buffer--;
- length--;
- }
- }
- else if (c == '\r') // carriage return
- break;
- else if ((c >= ' ') && (c <= '~') && (length < (max_size-1))) {
- if (echo) {
- neo430_uart_putc(c); // echo
- }
- *buffer++ = c;
- length++;
- }
- }
- *buffer = '\0'; // terminate string
-
- return length;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print single (capital) hexadecimal value (1 digit)
- * PARAM char to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_hex_char(char c) {
-
- char d = c & 15;
- if (d < 10)
- d += '0';
- else
- d += 'A'-10;
- neo430_uart_putc(d);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 8-bit hexadecimal value (2 digits)
- * PARAM uint8_t value to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_hex_byte(uint8_t b) {
-
- neo430_uart_print_hex_char((char)(b >> 4));
- neo430_uart_print_hex_char((char)(b >> 0));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 16-bit hexadecimal value (4 digits)
- * PARAM uint16_t value to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_hex_word(uint16_t w) {
-
- neo430_uart_print_hex_byte((uint8_t)(w >> 8));
- neo430_uart_print_hex_byte((uint8_t)(w >> 0));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 32-bit hexadecimal value (8 digits)
- * PARAM uint32_t value to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_hex_dword(uint32_t dw) {
-
- neo430_uart_print_hex_word((uint16_t)(dw >> 16));
- neo430_uart_print_hex_word((uint16_t)(dw >> 0));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 8-bit binary value (8 digits)
- * PARAM uint8_t value to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_bin_byte(uint8_t b) {
-
- uint8_t i;
- for (i=0x80; i!=0; i>>=1) {
- if (b & i)
- neo430_uart_putc('1');
- else
- neo430_uart_putc('0');
- }
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 16-bit decimal value (16 digits)
- * PARAM uint16_t value to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_bin_word(uint16_t w) {
-
- neo430_uart_print_bin_byte((uint8_t)(w >> 8));
- neo430_uart_print_bin_byte((uint8_t)(w >> 0));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 32-bit decimal value (32 digits)
- * PARAM uint32_t value to be printed
- * ------------------------------------------------------------ */
-void neo430_uart_print_bin_dword(uint32_t dw) {
-
- neo430_uart_print_bin_word((uint16_t)(dw >> 16));
- neo430_uart_print_bin_word((uint16_t)(dw >> 0));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print 32-bit number as decimal number
- * INFO Slow custom version of itoa
- * PARAM 32-bit value to be printed as decimal number
- * PARAM show leading zeros when set
- * ------------------------------------------------------------ */
-void neo430_itoa(uint32_t x, const uint16_t leading_zeros) {
-
- static const char numbers[10] = "0123456789";
- char buffer1[11], buffer2[11];
- uint16_t i, j;
-
- buffer1[10] = '\0';
- buffer2[10] = '\0';
-
- // convert
- for (i=0; i<10; i++) {
- buffer1[i] = numbers[x%10];
- x /= 10;
- }
-
- // delete 'leading' zeros
- for (i=9; i!=leading_zeros; i--) {
- if (buffer1[i] == '0')
- buffer1[i] = '\0';
- else
- break;
- }
-
- // reverse
- j = 0;
- do {
- if (buffer1[i] != '\0')
- buffer2[j++] = buffer1[i];
- } while (i--);
-
- buffer2[j] = '\0'; // terminate result string
-
- neo430_uart_br_print(buffer2);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Embedded version of the printf function with reduced functionality
- * INFO Only use this function if it is really required!
- * INFO It is large and slow... ;)
- * INFO Original from http://forum.43oh.com/topic/1289-tiny-printf-c-version/
- * PARAM Argument string
- * ------------------------------------------------------------ */
-void neo430_printf(char *format, ...) {
-
- char c;
- int32_t n;
-
- va_list a;
- va_start(a, format);
-
- while ((c = *format++)) {
- if (c == '%') {
- c = *format++;
- switch (c) {
- case 's': // string
- neo430_uart_print(va_arg(a, char*));
- break;
- case 'c': // char
- neo430_uart_putc((char)va_arg(a, int));
- break;
- case 'i': // 16-bit integer
- n = (int32_t)va_arg(a, int);
- if (n < 0) {
- n = -n;
- neo430_uart_putc('-');
- }
- neo430_itoa((uint32_t)n, 0);
- break;
- case 'u': // 16-bit unsigned
- neo430_itoa((uint32_t)va_arg(a, unsigned int), 0);
- break;
- case 'l': // 32-bit long
- n = (int32_t)va_arg(a, int32_t);
- if (n < 0) {
- n = -n;
- neo430_uart_putc('-');
- }
- neo430_itoa((uint32_t)n, 0);
- break;
- case 'n': // 32-bit unsigned long
- neo430_itoa(va_arg(a, uint32_t), 0);
- break;
- case 'x': // 16-bit hexadecimal
- neo430_uart_print_hex_word(va_arg(a, unsigned int));
- break;
- case 'X': // 32-bit hexadecimal
- neo430_uart_print_hex_dword(va_arg(a, uint32_t));
- break;
- default:
- return;
- }
- }
- else {
- if (c == '\n')
- neo430_uart_putc('\r');
- neo430_uart_putc(c);
- }
- }
- va_end(a);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print fixed point number
- * INFO HIGHLY EXPERIMENTAL!
- * PARAM fixed point number (32-bit)
- * PARAM number of fractional bits
- * ------------------------------------------------------------ */
-void neo430_fp_print(int32_t num, const uint16_t fp) {
-
- // print integer part
- int32_t num_int = num;
-
- if (num_int < (int32_t)0) {
- num_int = -num_int;
- neo430_uart_putc('-');
- }
- neo430_itoa((uint32_t)num_int >> fp, 0);
-
- neo430_uart_putc('.');
-
- // print fractional part (3 digits)
- uint32_t frac_part = (uint32_t)(num_int & ((1<= '0') && (c <= '9'))
- d = (uint32_t)(c - '0');
- else if ((c >= 'a') && (c <= 'f'))
- d = (uint32_t)((c - 'a') + 10);
- else if ((c >= 'A') && (c <= 'F'))
- d = (uint32_t)((c - 'A') + 10);
- else
- d = 0;
-
- res = res + (d << (length*4));
- }
-
- return res;
-}
Index: trunk/sw/lib/neo430/source/neo430_spi.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_spi.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_spi.c (nonexistent)
@@ -1,89 +0,0 @@
-// #################################################################################################
-// # < neo430_usart.h - Internal SPI module driver functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 04.10.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_spi.h"
-
-
-/* ------------------------------------------------------------
- * INFO Reset, activate, configure and enable SPI module
- * INFO SPI SCK speed: f_main/(2*PRSC), prsc = see below (control reg)
- * SPI clock prescaler select:
- * 0: CLK/2
- * 1: CLK/4
- * 2: CLK/8
- * 3: CLK/64
- * 4: CLK/128
- * 5: CLK/1024
- * 6: CLK/2048
- * 7: CLK/4096
- * ------------------------------------------------------------ */
-void neo430_spi_enable(uint8_t prsc) {
-
- SPI_CT = 0; // reset
- SPI_CT = (1 << SPI_CT_EN) | (prsc< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.03.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_aux.h"
-
-
-/* ------------------------------------------------------------
- * INFO Configure Timer period
- * PARAM Timer frequency in Hz (1Hz ... F_CPU/2)
- * RETURN 0 if successful, -1 if error
- * ------------------------------------------------------------ */
-uint8_t neo430_config_timer_period(uint32_t f_timer) {
-
- uint32_t clock = CLOCKSPEED_32bit;
- uint32_t ticks = (clock / (f_timer*2)) >> 1; // divide by lowest prescaler (=2)
-
- uint8_t prsc = 0;
-
- if (ticks == 0)
- return -1; // frequency too high!
-
- // find prescaler
- while(prsc < 8) {
- if (ticks <= 0x0000ffff)
- break;
- else {
- if ((prsc == 2) || (prsc == 4))
- ticks >>= 3;
- else
- ticks >>= 1;
- prsc++;
- }
- }
-
- TMR_THRES = (uint16_t)ticks;
- TMR_CT &= ~(7< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.03.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_gpio.h"
-
-
-/* ------------------------------------------------------------
- * INFO Set output pin
- * PARAM Pin number to be set (0..15)
- * ------------------------------------------------------------ */
-void neo430_gpio_pin_set(uint8_t p) {
-
- GPIO_OUTPUT = GPIO_OUTPUT | (uint16_t)(1 << p);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Clear output pin
- * PARAM Pin number to be cleared (0..15)
- * ------------------------------------------------------------ */
-void neo430_gpio_pin_clr(uint8_t p) {
-
- GPIO_OUTPUT = GPIO_OUTPUT & ~((uint16_t)(1 << p));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Set output port
- * PARAM Output data
- * ------------------------------------------------------------ */
-void neo430_gpio_port_set(uint16_t d) {
-
- GPIO_OUTPUT = d;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Toggle output port
- * PARAM Toggle output data
- * ------------------------------------------------------------ */
-void neo430_gpio_port_toggle(uint16_t d) {
-
- GPIO_OUTPUT = GPIO_OUTPUT ^ d;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Toggle output pin
- * PARAM Pin number (0..15)
- * ------------------------------------------------------------ */
-void neo430_gpio_pin_toggle(uint8_t p) {
-
- GPIO_OUTPUT = GPIO_OUTPUT ^ (uint16_t)(1 << p);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get input pin state
- * PARAM Pin number (0..15)
- * RETURN 0 if pin cleared, pin set otherwise
- * ------------------------------------------------------------ */
-uint16_t neo430_gpio_pin_get(uint8_t p) {
-
- return GPIO_INPUT & (uint16_t)(1 << p);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get input port
- * RETURN Input port state
- * ------------------------------------------------------------ */
-uint16_t neo430_gpio_port_get(void) {
-
- return GPIO_INPUT;
-}
Index: trunk/sw/lib/neo430/source/neo430_wdt.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_wdt.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_wdt.c (nonexistent)
@@ -1,65 +0,0 @@
-// #################################################################################################
-// # < neo430_wdt.h - Watchdog helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.03.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_wdt.h"
-
-
-/* ------------------------------------------------------------
- * INFO Enable watchdog
- * PARAM Prescaler selection (0..7)
- * ------------------------------------------------------------ */
-void neo430_wdt_enable(uint8_t prsc) {
-
- WDT_CT = (WDT_CT_PASSWORD<<8) | (1< triggers reset
-}
Index: trunk/sw/lib/neo430/source/neo430_wishbone.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_wishbone.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_wishbone.c (nonexistent)
@@ -1,649 +0,0 @@
-// #################################################################################################
-// # < neo430_wishbone.h - Internal Wishbone interface control functions > #
-// # ********************************************************************************************* #
-// # Use the normal Wishbone functions for BLOCKING access (until ACK is asserted). #
-// # Use non-blocking functions (*_start, wishbone_busy, wishbone_get_data*) to prevent dead locks #
-// # when accessing invalid addresses and to do things in parallel when using the Wishbone bus. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Thanks to Edward Sherriff! #
-// # Stephan Nolting, Hannover, Germany 04.10.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_wishbone.h"
-
-
-// ************************************************************************************************
-// Byte-wise access functions, with address alignment, blocking
-// ************************************************************************************************
-
-/* ------------------------------------------------------------
- * INFO Read 32-bit from Wishbone device (blocking), standard mode, pipelined
- * PARAM 32-bit device address
- * RETURN read data
- * ------------------------------------------------------------ */
-uint32_t neo430_wishbone32_read32(uint32_t a) {
-
- // 32-bit transfer
- WB32_CT = 0xF;
-
- // device address aligned to 32-bit + transfer trigger
- WB32_RA_32bit = a & (~3);
-
- // wait for access to be completed - blocking!
- while((WB32_CT & (1< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 13.03.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_muldiv.h"
-
-
-/* ------------------------------------------------------------
- * INFO Unsigned 16x16-bit multiplication
- * PARAM 16-bit factor a
- * PARAM 16-bit factor b
- * RETURN 32-bit product
- * ------------------------------------------------------------ */
-uint32_t neo430_umul32(uint16_t a, uint16_t b) {
-
- MULDIV_OPA = a;
- MULDIV_OPB_MUL = b;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- return MULDIV_R32bit;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Signed 16x16-bit multiplication
- * PARAM 16-bit factor a
- * PARAM 16-bit factor b
- * RETURN 32-bit product
- * ------------------------------------------------------------ */
-int32_t neo430_mul32(int16_t a, int16_t b) {
-
- int16_t sign = a ^ b;
-
- // make positive / unsigned
- if (a < 0)
- a = 0 - a;
- if (b < 0)
- b = 0 - b;
-
- MULDIV_OPA = (uint16_t)a;
- MULDIV_OPB_MUL = (uint16_t)b;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- int32_t r = (int32_t)MULDIV_R32bit;
-
- if (sign < 0)
- return 0 - r;
- else
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Unsigned 16 by 16-bit division
- * PARAM 16-bit dividend
- * PARAM 16-bit divisor
- * RETURN 16-bit quotient
- * ------------------------------------------------------------ */
-uint16_t neo430_udiv16(uint16_t dividend, uint16_t divisor) {
-
- MULDIV_OPA = dividend;
- MULDIV_OPB_DIV = divisor;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- return MULDIV_RESX;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Signed 16 by 16-bit division
- * PARAM 16-bit dividend
- * PARAM 16-bit divisor
- * RETURN 16-bit quotient
- * ------------------------------------------------------------ */
-int16_t neo430_div16(int16_t dividend, int16_t divisor) {
-
- // make positive / unsigned
- if (dividend < 0)
- dividend = 0 - dividend;
- if (divisor < 0)
- divisor = 0 - divisor;
-
- MULDIV_OPA = (uint16_t)dividend;
- MULDIV_OPB_DIV = (uint16_t)divisor;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- int16_t r = (int16_t)MULDIV_RESX;
-
- if (dividend < 0)
- return 0 - r;
- else
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Unsigned 16 by 16-bit division
- * PARAM 16-bit dividend
- * PARAM 16-bit divisor
- * RETURN 16-bit remainder
- * ------------------------------------------------------------ */
-uint16_t neo430_umod16(uint16_t dividend, uint16_t divisor) {
-
- MULDIV_OPA = dividend;
- MULDIV_OPB_DIV = divisor;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- return MULDIV_RESY;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Signed 16 by 16-bit division
- * PARAM 16-bit dividend
- * PARAM 16-bit divisor
- * RETURN 16-bit remainder
- * ------------------------------------------------------------ */
-int16_t neo430_mod16(int16_t dividend, int16_t divisor) {
-
- int16_t dividend_int = dividend;
-
- // make positive / unsigned
- if (dividend_int < 0)
- dividend_int = 0 - dividend_int;
- if (divisor < 0)
- divisor = 0 - divisor;
-
- MULDIV_OPA = (uint16_t)dividend_int;
- MULDIV_OPB_DIV = (uint16_t)divisor;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- int16_t r = (int16_t)MULDIV_RESY;
-
- if (dividend < 0)
- return 0 - r;
- else
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Unsigned 16 by 16-bit division
- * PARAM 16-bit dividend
- * PARAM 16-bit divisor
- * PARAM Pointer to store 16-bit remainder
- * RETURN 16-bit quotient
- * ------------------------------------------------------------ */
-uint16_t neo430_umoddiv16(uint16_t *remainder, uint16_t dividend, uint16_t divisor) {
-
- MULDIV_OPA = dividend;
- MULDIV_OPB_DIV = divisor;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- *remainder = MULDIV_RESY;
- return MULDIV_RESX;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Signed 16 by 16-bit division
- * PARAM 16-bit dividend
- * PARAM 16-bit divisor
- * PARAM Pointer to store 16-bit remainder
- * RETURN 16-bit quotient
- * ------------------------------------------------------------ */
-int16_t neo430_moddiv16(int16_t *remainder, int16_t dividend, int16_t divisor) {
-
- int16_t sign = dividend ^ divisor;
- int16_t dividend_int = dividend;
-
- // make positive / unsigned
- if (dividend_int < 0)
- dividend_int = 0 - dividend_int;
- if (divisor < 0)
- divisor = 0 - divisor;
-
- MULDIV_OPA = (uint16_t)dividend_int;
- MULDIV_OPB_DIV = (uint16_t)divisor;
-
- // HW processing delay
- asm volatile("nop");
- asm volatile("nop");
- asm volatile("nop");
-
- int16_t q = (int16_t)MULDIV_RESX;
- int16_t r = (int16_t)MULDIV_RESY;
-
- if (dividend < 0)
- *remainder = 0 - r;
- else
- *remainder = r;
-
- if (sign < 0)
- return 0 - q;
- else
- return q;
-}
Index: trunk/sw/lib/neo430/source/neo430_pwm.c
===================================================================
--- trunk/sw/lib/neo430/source/neo430_pwm.c (revision 167)
+++ trunk/sw/lib/neo430/source/neo430_pwm.c (nonexistent)
@@ -1,80 +0,0 @@
-// #################################################################################################
-// # < neo430_pwm.h - PWM controller helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 12.05.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_pwm.h"
-
-
-/* ------------------------------------------------------------
- * INFO Reset and activate PWM controller
- * PARAM prsc: Clock prescaler for PWM clock
- * PARAM size: Actual bit width of PWM counter (1..8)
- * ------------------------------------------------------------ */
-void neo430_pwm_enable(uint8_t prsc, uint8_t size) {
-
- PWM_CT = 0; // reset
- PWM_CT = (1< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 10.10.2019 #
-// #################################################################################################
-
-#include "neo430.h"
-#include "neo430_twi.h"
-
-
-/* ------------------------------------------------------------
- * INFO Activate (and reset) TWI module
- * PARAM clock prescaler
- * ------------------------------------------------------------ */
-void neo430_twi_enable(uint8_t prsc) {
-
- TWI_CT = 0; // reset
- TWI_CT = (1 << TWI_CT_EN) | (prsc << TWI_CT_PRSC0);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Deactivate TWI module
- * ------------------------------------------------------------ */
-void neo430_twi_disable(void) {
-
- TWI_CT = 0;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Generate START condition and send first byte (address & R/W)
- * PARAM 8-bit including 7-bit address and read/write bit
- * RETURN 0 if ACK received, 0xff if no valid ACK was received
- * ------------------------------------------------------------ */
-uint8_t neo430_twi_start_trans(uint8_t a) {
-
- neo430_twi_generate_start(); // generate START condition
-
- TWI_DATA = (uint16_t)a; // send data
- while(TWI_CT & (1 << TWI_CT_BUSY)); // wait until idle again
-
- // check for ACK/NACK
- if (TWI_DATA & (1 << TWI_DT_ACK))
- return 0x00; // ACK received
- else
- return 0xff; // NACK received
-}
-
-
-/* ------------------------------------------------------------
- * INFO Send data and also sample input data
- * PARAM Data byte to be sent
- * RETURN 0 if ACK received, 0xff if no valid ACK was received
- * ------------------------------------------------------------ */
-uint8_t neo430_twi_trans(uint8_t d) {
-
- TWI_DATA = (uint16_t)d; // send data
- while(TWI_CT & (1 << TWI_CT_BUSY)); // wait until idle again
-
- // check for ACK/NACK
- if (TWI_DATA & (1 << TWI_DT_ACK))
- return 0x00; // ACK received
- else
- return 0xff; // NACK received
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get receive data from previous transmission
- * RETURN Last received data byte
- * ------------------------------------------------------------ */
-uint8_t neo430_twi_get_data(void) {
-
- return (uint8_t)TWI_DATA; // get RX data from previous transmission
-}
-
-
-/* ------------------------------------------------------------
- * INFO Generate STOP condition
- * ------------------------------------------------------------ */
-void neo430_twi_generate_stop(void) {
-
- TWI_CT |= (1 << TWI_CT_STOP); // generate STOP condition
- while(TWI_CT & (1 << TWI_CT_BUSY)); // wait until idle again
-}
-
-
-/* ------------------------------------------------------------
- * INFO Generate START condition
- * ------------------------------------------------------------ */
-void neo430_twi_generate_start(void) {
-
- TWI_CT |= (1 << TWI_CT_START); // generate START condition
- while(TWI_CT & (1 << TWI_CT_BUSY)); // wait until idle again
-}
Index: trunk/sw/lib/neo430/include/neo430_pwm.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_pwm.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_pwm.h (nonexistent)
@@ -1,33 +0,0 @@
-// #################################################################################################
-// # < neo430_pwm.h - PWM controller helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 12.05.2019 #
-// #################################################################################################
-
-#ifndef neo430_pwm_h
-#define neo430_pwm_h
-
-// prototypes
-void neo430_pwm_enable(uint8_t prsc, uint8_t size);
-void neo430_pwm_disable(void);
-void neo430_pwm_set(uint8_t channel, uint8_t dc);
-
-#endif // neo430_pwm_h
Index: trunk/sw/lib/neo430/include/neo430_twi.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_twi.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_twi.h (nonexistent)
@@ -1,37 +0,0 @@
-// #################################################################################################
-// # < neo430_twi.h - Internal Two Wire Serial interface functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 10.10.2019 #
-// #################################################################################################
-
-#ifndef neo430_twi_h
-#define neo430_twi_h
-
-// prototypes
-void neo430_twi_enable(uint8_t prsc); // configure and activate TWI module
-void neo430_twi_disable(void); // deactivate TWI module
-uint8_t neo430_twi_start_trans(uint8_t a); // start transmission (START) and send address and r/w bit
-uint8_t neo430_twi_trans(uint8_t d); // send byte to active slave
-uint8_t neo430_twi_get_data(void); // get last received data byte
-void neo430_twi_generate_stop(void); // stop transmission (STOP)
-void neo430_twi_generate_start(void); // generate start condition
-
-#endif // neo430_twi_h
Index: trunk/sw/lib/neo430/include/neo430_crc.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_crc.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_crc.h (nonexistent)
@@ -1,39 +0,0 @@
-// #################################################################################################
-// # < neo430_crc.h - CRC module helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 01.03.2019 #
-// #################################################################################################
-
-#ifndef neo430_crc_h
-#define neo430_crc_h
-
-// prototypes
-uint16_t neo430_crc16(uint16_t start_val, uint16_t polynomial, uint8_t *data, uint16_t length);
-uint32_t neo430_crc32(uint32_t start_val, uint32_t polynomial, uint8_t *data, uint16_t length);
-
-void neo430_crc16_set_start_value(uint16_t start_val);
-void neo430_crc32_set_start_value(uint32_t start_val);
-void neo430_crc16_set_polynomial(uint16_t poly);
-void neo430_crc32_set_polynomial(uint32_t poly);
-uint16_t neo430_crc16_iterate(uint8_t data);
-uint32_t neo430_crc32_iterate(uint8_t data);
-
-#endif // neo430_crc_h
Index: trunk/sw/lib/neo430/include/neo430_cpu.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_cpu.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_cpu.h (nonexistent)
@@ -1,50 +0,0 @@
-// #################################################################################################
-// # < neo430_cpu.h - CPU helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 01.03.2019 #
-// #################################################################################################
-
-#ifndef neo430_cpu_h
-#define neo430_cpu_h
-
-// prototypes
-void neo430_eint(void);
-void neo430_dint(void);
-uint16_t neo430_get_sp(void);
-uint16_t neo430_get_sreg(void);
-void neo430_set_sreg(uint16_t d);
-void neo430_sleep(void);
-void neo430_clear_irq_buffer(void);
-void neo430_cpu_delay(uint16_t t);
-void neo430_cpu_delay_ms(uint16_t ms);
-void neo430_soft_reset(void);
-void neo430_jump_address(uint16_t addr);
-void neo430_call_address(uint16_t addr);
-uint16_t neo430_bswap(uint16_t a);
-uint16_t neo430_combine_bytes(uint8_t hi, uint8_t lo);
-uint16_t neo430_dadd(uint16_t a, uint16_t b);
-void neo430_memset(uint8_t *dst, uint8_t data, uint16_t num);
-uint8_t neo430_memcmp(uint8_t *dst, uint8_t *src, uint16_t num);
-void neo430_memcpy(uint8_t *dst, uint8_t *src, uint16_t num);
-uint16_t neo430_bit_rev16(uint16_t x);
-uint32_t neo430_xorshift32(void);
-
-#endif // neo430_cpu_h
Index: trunk/sw/lib/neo430/include/neo430_uart.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_uart.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_uart.h (nonexistent)
@@ -1,52 +0,0 @@
-// #################################################################################################
-// # < neo430_usart.h - Internal UARt driver functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 18.01.2019 #
-// #################################################################################################
-
-#ifndef neo430_uart_h
-#define neo430_uart_h
-
-// Libs required by functions
-#include
-
-// prototypes
-void neo430_uart_setup(uint32_t baudrate); // activate and configure UART
-void neo430_uart_putc(char c); // send single char
-char neo430_uart_getc(void); // wait and read single char
-uint16_t neo430_uart_char_received(void); // test if a char has been received
-char neo430_uart_char_read(void); // get a received char
-void neo430_uart_print(char *s); // print a text string
-void neo430_uart_br_print(char *s); // print a text string and allow easy line breaks
-uint16_t neo430_uart_scan(char *buffer, uint16_t max_size, uint16_t echo); // read several chars into buffer
-void neo430_uart_print_hex_char(char c); // print byte as a hex char
-void neo430_uart_print_hex_byte(uint8_t b); // print byte as 2 hex numbers
-void neo430_uart_print_hex_word(uint16_t w); // print word as 4 hex numbers
-void neo430_uart_print_hex_dword(uint32_t dw); // print double word as 8 hex numbers
-void neo430_uart_print_bin_byte(uint8_t b); // print byte in binary form
-void neo430_uart_print_bin_word(uint16_t w); // print word in binary form
-void neo430_uart_print_bin_dword(uint32_t dw); // print double word in binary form
-void neo430_itoa(uint32_t x, const uint16_t leading_zeros); // convert double word to decimal number
-void neo430_printf(char *format, ...); // print format string
-void neo430_fp_print(int32_t num, const uint16_t fp); // print fixed point number
-uint32_t neo430_hexstr_to_uint(char *buffer, uint8_t length); // convert hex string to number
-
-#endif // neo430_uart_h
Index: trunk/sw/lib/neo430/include/neo430_spi.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_spi.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_spi.h (nonexistent)
@@ -1,35 +0,0 @@
-// #################################################################################################
-// # < neo430_usart.h - Internal SPI module driver functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 04.10.2019 #
-// #################################################################################################
-
-#ifndef neo430_spi_h
-#define neo430_spi_h
-
-// prototypes
-void neo430_spi_enable(uint8_t prsc); // configure and activate SPI module
-void neo430_spi_disable(void); // deactivate SPI module
-void neo430_spi_cs_en(uint8_t cs); // activate slave
-void neo430_spi_cs_dis(void); // deactivate all slaves
-uint8_t neo430_spi_trans(uint8_t d); // RTX transfer
-
-#endif // neo430_spi_h
Index: trunk/sw/lib/neo430/include/neo430_aux.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_aux.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_aux.h (nonexistent)
@@ -1,31 +0,0 @@
-// #################################################################################################
-// # < neo430_aux.h - Handy helper functions ;) > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 04.07.2018 #
-// #################################################################################################
-
-#ifndef neo430_aux_h
-#define neo430_aux_h
-
-// prototypes
-uint8_t neo430_config_timer_period(uint32_t f_timer);
-
-#endif // neo430_aux_h
Index: trunk/sw/lib/neo430/include/neo430_wdt.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_wdt.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_wdt.h (nonexistent)
@@ -1,34 +0,0 @@
-// #################################################################################################
-// # < neo430_wdt.h - Watchdog helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 04.07.2018 #
-// #################################################################################################
-
-#ifndef neo430_wdt_h
-#define neo430_wdt_h
-
-// prototypes
-void neo430_wdt_enable(uint8_t prsc);
-void neo430_wdt_disable(void);
-void neo430_wdt_reset(void);
-void neo430_wdt_force_hw_reset(void);
-
-#endif // neo430_wdt_h
Index: trunk/sw/lib/neo430/include/neo430_gpio.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_gpio.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_gpio.h (nonexistent)
@@ -1,37 +0,0 @@
-// #################################################################################################
-// # < neo430_gpio.h - PIO controller helper functions > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 04.07.2018 #
-// #################################################################################################
-
-#ifndef neo430_gpio_h
-#define neo430_gpio_h
-
-// prototypes
-void neo430_gpio_pin_set(uint8_t p);
-void neo430_gpio_pin_clr(uint8_t p);
-void neo430_gpio_port_set(uint16_t d);
-void neo430_gpio_port_toggle(uint16_t d);
-void neo430_gpio_pin_toggle(uint8_t p);
-uint16_t neo430_gpio_pin_get(uint8_t p);
-uint16_t neo430_gpio_port_get(void);
-
-#endif // neo430_gpio_h
Index: trunk/sw/lib/neo430/include/neo430_wishbone.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_wishbone.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_wishbone.h (nonexistent)
@@ -1,96 +0,0 @@
-// #################################################################################################
-// # < neo430_wishbone.h - Internal Wishbone interface control functions > #
-// # ********************************************************************************************* #
-// # Use the normal Wishbone functions for BLOCKING access (until ACK is asserted). #
-// # Use non-blocking functions (*_start, wishbone_busy, wishbone_get_data*) to prevent dead locks #
-// # when accessing invalid addresses and to do things in parallel when using the Wishbone bus. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Thanks to Edward Sherriff! #
-// # Stephan Nolting, Hannover, Germany 04.10.2019 #
-// #################################################################################################
-
-#ifndef neo430_wishbone_h
-#define neo430_wishbone_h
-
-// prototypes blocking functions for 32-bit data bus width
-uint32_t neo430_wishbone32_read32(uint32_t a);
-void neo430_wishbone32_write32(uint32_t a, uint32_t d);
-
-uint16_t neo430_wishbone32_read16(uint32_t a); // This function performs a data alignment based on the address!
-void neo430_wishbone32_write16(uint32_t a, uint16_t d); // This function performs a data alignment based on the address!
-
-uint8_t neo430_wishbone32_read8(uint32_t a); // This function performs a data alignment based on the address!
-void neo430_wishbone32_write8(uint32_t a, uint8_t d); // This function performs a data alignment based on the address!
-
-// prototypes non-blocking functions for 32-bit data bus width
-void neo430_wishbone32_read32_start(uint32_t a);
-void neo430_wishbone32_write32_start(uint32_t a, uint32_t d);
-
-void neo430_wishbone32_read16_start(uint32_t a);
-void neo430_wishbone32_write16_start(uint32_t a, uint16_t d); // This function performs a data alignment based on the address!
-
-void neo430_wishbone32_read8_start(uint32_t a);
-void neo430_wishbone32_write8_start(uint32_t a, uint8_t d); // This function performs a data alignment based on the address!
-
-uint32_t neo430_wishbone32_get_data32(void);
-uint16_t neo430_wishbone32_get_data16(uint32_t a); // This function performs a data alignment based on the address!
-uint8_t neo430_wishbone32_get_data8(uint32_t a); // This function performs a data alignment based on the address!
-
-// -------------
-
-// prototypes blocking functions for 32-bit data bus width using NO ADDRESS ALIGNMENT
-uint32_t neo430_wishbone32_read(uint32_t a);
-void neo430_wishbone32_write(uint32_t a, uint32_t d);
-
-// prototypes non-blocking functions for 32-bit data bus width using NO ADDRESS ALIGNMENT
-void neo430_wishbone32_read_start(uint32_t a);
-void neo430_wishbone32_write_start(uint32_t a, uint32_t d);
-uint32_t neo430_wishbone32_get_data(void);
-
-// -------------
-
-// prototypes blocking functions for 16-bit data bus width using NO ADDRESS ALIGNMENT
-uint16_t neo430_wishbone16_read(uint32_t a);
-void neo430_wishbone16_write(uint32_t a, uint16_t d);
-
-// prototypes non-blocking functions for 16-bit data bus width using NO ADDRESS ALIGNMENT
-void neo430_wishbone16_read_start(uint32_t a);
-void neo430_wishbone16_write_start(uint32_t a, uint16_t d);
-uint16_t neo430_wishbone16_get_data(void);
-
-// -------------
-
-// prototypes blocking functions for 8-bit data bus width using NO ADDRESS ALIGNMENT
-uint8_t neo430_wishbone8_read(uint32_t a);
-void neo430_wishbone8_write(uint32_t a, uint8_t d);
-
-// prototypes non-blocking functions for 8-bit data bus width using NO ADDRESS ALIGNMENT
-void neo430_wishbone8_read_start(uint32_t a);
-void neo430_wishbone8_write_start(uint32_t a, uint8_t d);
-uint8_t neo430_wishbone8_get_data8(void);
-
-// -------------
-
-// general status funtion prototypes
-uint16_t neo430_wishbone_busy(void);
-void neo430_wishbone_terminate(void);
-
-#endif // neo430_wishbone_h
Index: trunk/sw/lib/neo430/include/neo430_muldiv.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430_muldiv.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430_muldiv.h (nonexistent)
@@ -1,41 +0,0 @@
-// #################################################################################################
-// # < neo430_muldiv.h - Multiplier/Divider function > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 04.07.2018 #
-// #################################################################################################
-
-#ifndef neo430_muldiv_h
-#define neo430_muldiv_h
-
-// prototypes
-uint32_t neo430_umul32(uint16_t a, uint16_t b);
-int32_t neo430_mul32(int16_t a, int16_t b);
-
-uint16_t neo430_udiv16(uint16_t dividend, uint16_t divisor);
-int16_t neo430_div16(int16_t dividend, int16_t divisor);
-
-uint16_t neo430_umod16(uint16_t dividend, uint16_t divisor);
-int16_t neo430_mod16(int16_t dividend, int16_t divisor);
-
-uint16_t neo430_umoddiv16(uint16_t *remainder, uint16_t dividend, uint16_t divisor);
-int16_t neo430_moddiv16(int16_t *remainder, int16_t dividend, int16_t divisor);
-
-#endif // neo430_muldiv_h
Index: trunk/sw/lib/neo430/include/neo430.h
===================================================================
--- trunk/sw/lib/neo430/include/neo430.h (revision 167)
+++ trunk/sw/lib/neo430/include/neo430.h (nonexistent)
@@ -1,396 +0,0 @@
-// #################################################################################################
-// # < neo430.h - MAIN NEO430 INCLUDE FILE > #
-// # ********************************************************************************************* #
-// # This file is crucial for all NEO430 software projects! #
-// # You only need to include THIS file into your project code (all sub-libraries are included #
-// # within this library file). #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 23.09.2019 #
-// #################################################################################################
-
-#ifndef neo430_h
-#define neo430_h
-
-// Standard libraries
-#include
-#include
-
-// ----------------------------------------------------------------------------
-// CPU Status Register (r2) Flags
-// ----------------------------------------------------------------------------
-#define C_FLAG 0 // r/w: carry
-#define Z_FLAG 1 // r/w: zero
-#define N_FLAG 2 // r/w: negative
-#define I_FLAG 3 // r/w: global interrupt enable
-#define S_FLAG 4 // r/w: sleep
-#define V_FLAG 8 // r/w: overflow
-#define Q_FLAG 14 // -/w: clear pending IRQ buffer when set
-#define R_FLAG 15 // r/w: allow write-access to IMEM
-
-
-// ----------------------------------------------------------------------------
-// Processor peripheral/IO devices
-// Beginning of IO area: 0xFF80
-// Size of IO area: 128 bytes
-// ----------------------------------------------------------------------------
-#define REG8 (volatile uint8_t*) // memory-mapped register
-#define REG16 (volatile uint16_t*) // memory-mapped register
-#define REG32 (volatile uint32_t*) // memory-mapped register
-#define ROM8 (const volatile uint8_t*) // read-only
-#define ROM16 (const volatile uint16_t*) // read-only
-#define ROM32 (const volatile uint32_t*) // read-only
-
-
-// ----------------------------------------------------------------------------
-// Start of data memory (DMEN)
-// ----------------------------------------------------------------------------
-#define DMEM_ADDR_BASE 0xC000
-
-
-// ----------------------------------------------------------------------------
-// Interrupt vectors, located at the beginning of DMEM
-// ----------------------------------------------------------------------------
-#define IRQVEC_TIMER (*(REG16 (DMEM_ADDR_BASE + 0))) // r/w: timer match
-#define IRQVEC_SERIAL (*(REG16 (DMEM_ADDR_BASE + 2))) // r/w: uart/spi/twi irqs
-#define IRQVEC_GPIO (*(REG16 (DMEM_ADDR_BASE + 4))) // r/w: gpio pin change
-#define IRQVEC_EXT (*(REG16 (DMEM_ADDR_BASE + 6))) // r/w: external IRQ
-
-
-// ----------------------------------------------------------------------------
-// Unsigned Multiplier/Divider Unit (MULDIV)
-// ----------------------------------------------------------------------------
-#define MULDIV_OPA (*(REG16 0xFF80)) // -/w: operand A (dividend or factor1)
-#define MULDIV_OPB_DIV (*(REG16 0xFF82)) // -/w: operand B (divisor) for division
-#define MULDIV_OPB_MUL (*(REG16 0xFF84)) // -/w: operand B (factor2) for multiplication
-//#define reserved (*(REG16 0xFF86))
-//#define reserved (*(REG16 0xFF88))
-//#define reserved (*(REG16 0xFF8A))
-#define MULDIV_RESX (*(ROM16 0xFF8C)) // r/-: quotient or product low word
-#define MULDIV_RESY (*(ROM16 0xFF8E)) // r/-: remainder or product high word
-#define MULDIV_R32bit (*(ROM32 (&MULDIV_RESX))) // r/-: read result as 32-bit data word
-
-
-// ----------------------------------------------------------------------------
-// Wishbone Bus Adapter (WB32)
-// ----------------------------------------------------------------------------
-#define WB32_CT (*(REG16 0xFF90)) // r/w: control register
-#define WB32_LRA (*(REG16 0xFF92)) // -/w: low address for read transfer
-#define WB32_HRA (*(REG16 0xFF94)) // -/w: high address for read transfer (+trigger)
-#define WB32_LWA (*(REG16 0xFF96)) // -/w: low address for write transfer
-#define WB32_HWA (*(REG16 0xFF98)) // -/w: high address for write transfer (+trigger)
-#define WB32_LD (*(REG16 0xFF9A)) // r/w: low data
-#define WB32_HD (*(REG16 0xFF9C)) // r/w: high data
-//#define reserved (*(REG16 0xFF9E)) // -/-: reserved
-
-// WB32 - 32-bit register access
-#define WB32_RA_32bit (*(REG32 (&WB32_LRA))) // -/w: address for read transfer (+trigger)
-#define WB32_WA_32bit (*(REG32 (&WB32_LWA))) // -/w: address for write transfer (+trigger)
-#define WB32_D_32bit (*(REG32 (&WB32_LD))) // r/w: read/write data (for 32-bit access)
-
-// WB32 control register
-#define WB32_CT_WBSEL0 0 // -/w: wishbone data byte enable bit 0
-#define WB32_CT_WBSEL1 1 // -/w: wishbone data byte enable bit 1
-#define WB32_CT_WBSEL2 2 // -/w: wishbone data byte enable bit 2
-#define WB32_CT_WBSEL3 3 // -/w: wishbone data byte enable bit 3
-#define WB32_CT_PENDING 15 // r/-: pending transfer
-
-
-// ----------------------------------------------------------------------------
-// Universal Asynchronous Receiver and Transmitter (UART)
-// ----------------------------------------------------------------------------
-#define UART_CT (*(REG16 0xFFA0)) // r/w: control register
-#define UART_RTX (*(REG16 0xFFA2)) // r/w: receive/transmit register
-
-// UART control register
-#define UART_CT_BAUD0 0 // r/w: baud config bit 0
-#define UART_CT_BAUD1 1 // r/w: baud config bit 1
-#define UART_CT_BAUD2 2 // r/w: baud config bit 2
-#define UART_CT_BAUD3 3 // r/w: baud config bit 3
-#define UART_CT_BAUD4 4 // r/w: baud config bit 4
-#define UART_CT_BAUD5 5 // r/w: baud config bit 5
-#define UART_CT_BAUD6 6 // r/w: baud config bit 6
-#define UART_CT_BAUD7 7 // r/w: baud config bit 7
-#define UART_CT_PRSC0 8 // r/w: baud presclaer bit 0
-#define UART_CT_PRSC1 9 // r/w: baud presclaer bit 1
-#define UART_CT_PRSC2 10 // r/w: baud presclaer bit 2
-
-#define UART_CT_EN 12 // r/w: UART enable
-#define UART_CT_RX_IRQ 13 // r/w: Rx done interrupt enable
-#define UART_CT_TX_IRQ 14 // r/w: Tx done interrupt enable
-#define UART_CT_TX_BUSY 15 // r/-: transmitter busy
-
-// UART RTX register flags
-#define UART_RTX_AVAIL 15 // r/-: uart receiver data available
-
-// clock prescalers
-#define UART_PRSC_2 0 // CLK/2
-#define UART_PRSC_4 1 // CLK/4
-#define UART_PRSC_8 2 // CLK/8
-#define UART_PRSC_64 3 // CLK/64
-#define UART_PRSC_128 4 // CLK/128
-#define UART_PRSC_1024 5 // CLK/1024
-#define UART_PRSC_2048 6 // CLK/2048
-#define UART_PRSC_4096 7 // CLK/4096
-
-
-// ----------------------------------------------------------------------------
-// Serial Peripheral Interface (SPI)
-// ----------------------------------------------------------------------------
-#define SPI_CT (*(REG16 0xFFA4)) // r/w: control register
-#define SPI_RTX (*(REG16 0xFFA6)) // r/w: receive/transmit register
-
-// SPI control register
-#define SPI_CT_EN 0 // r/w: spi enable
-#define SPI_CT_CPHA 1 // r/w: spi clock phase (idle polarity = '0')
-#define SPI_CT_IRQ 2 // r/w: spi transmission done interrupt enable
-#define SPI_CT_PRSC0 3 // r/w: spi clock prescaler select bit 0
-#define SPI_CT_PRSC1 4 // r/w: spi clock prescaler select bit 1
-#define SPI_CT_PRSC2 5 // r/w: spi clock prescaler select bit 2
-#define SPI_CT_CS_SEL0 6 // r/w: spi CS select 0
-#define SPI_CT_CS_SEL1 7 // r/w: spi CS select 1
-#define SPI_CT_CS_SEL2 8 // r/w: spi CS select 2
-#define SPI_CT_CS_SET 9 // r/w: selected CS becomes active ('0') when set
-
-#define SPI_CT_BUSY 15 // r/-: spi transceiver is busy
-
-// clock prescalers
-#define SPI_PRSC_2 0 // CLK/2
-#define SPI_PRSC_4 1 // CLK/4
-#define SPI_PRSC_8 2 // CLK/8
-#define SPI_PRSC_64 3 // CLK/64
-#define SPI_PRSC_128 4 // CLK/128
-#define SPI_PRSC_1024 5 // CLK/1024
-#define SPI_PRSC_2048 6 // CLK/2048
-#define SPI_PRSC_4096 7 // CLK/4096
-
-
-// ----------------------------------------------------------------------------
-// General Purpose Inputs/Outputs (GPIO)
-// ----------------------------------------------------------------------------
-//#define reserved (*(REG16 0xFFA8)) // reserved
-#define GPIO_IRQMASK (*(REG16 0xFFAA)) // -/w: irq mask register
-#define GPIO_INPUT (*(ROM16 0xFFAC)) // r/-: parallel input
-#define GPIO_OUTPUT (*(REG16 0xFFAE)) // r/w: parallel output
-
-
-// ----------------------------------------------------------------------------
-// High-Precision Timer (TIMER)
-// ----------------------------------------------------------------------------
-#define TMR_CT (*(REG16 0xFFB0)) // r/w: control register
-#define TMR_CNT (*(REG16 0xFFB2)) // r/w: counter register
-#define TMR_THRES (*(REG16 0xFFB4)) // r/w: threshold register
-//#define reserved (*(REG16 0xFFB6))
-
-// Timer control register
-#define TMR_CT_EN 0 // r/w: timer enable
-#define TMR_CT_ARST 1 // r/w: auto reset on match
-#define TMR_CT_IRQ 2 // r/w: interrupt enable
-#define TMR_CT_PRSC0 3 // r/w: clock prescaler select bit 0
-#define TMR_CT_PRSC1 4 // r/w: clock prescaler select bit 1
-#define TMR_CT_PRSC2 5 // r/w: clock prescaler select bit 2
-
-// Timer clock prescaler select:
-#define TMR_PRSC_2 0 // CLK/2
-#define TMR_PRSC_4 1 // CLK/4
-#define TMR_PRSC_8 2 // CLK/8
-#define TMR_PRSC_64 3 // CLK/64
-#define TMR_PRSC_128 4 // CLK/128
-#define TMR_PRSC_1024 5 // CLK/1024
-#define TMR_PRSC_2048 6 // CLK/2048
-#define TMR_PRSC_4096 7 // CLK/4096
-
-
-// ----------------------------------------------------------------------------
-// Watchdog Timer (WTD)
-// ----------------------------------------------------------------------------
-#define WDT_CT (*(REG16 0xFFB8)) // r/w: Watchdog control register
-
-// Watchdog control register
-#define WDT_CT_PASSWORD 0x47 // must be set in the upper 8 bits of the WDT CTRL register
-#define WDT_CT_PRSC0 0 // r/w: clock prescaler select bit 0
-#define WDT_CT_PRSC1 1 // r/w: clock prescaler select bit 1
-#define WDT_CT_PRSC2 2 // r/w: clock prescaler select bit 2
-#define WDT_CT_EN 3 // r/w: WDT enable
-#define WDT_CT_RCAUSE 4 // r/-: reset cause (0: external, 1: watchdog timeout)
-
-// Watchdog clock prescaler select:
-#define WDT_PRSC_2 0 // CLK/2
-#define WDT_PRSC_4 1 // CLK/4
-#define WDT_PRSC_8 2 // CLK/8
-#define WDT_PRSC_64 3 // CLK/64
-#define WDT_PRSC_128 4 // CLK/128
-#define WDT_PRSC_1024 5 // CLK/1024
-#define WDT_PRSC_2048 6 // CLK/2048
-#define WDT_PRSC_4096 7 // CLK/4096
-
-
-// ----------------------------------------------------------------------------
-// Cyclic Redundancy Check (CRC16/32)
-// ----------------------------------------------------------------------------
-#define CRC_POLY_LO (*(REG16 0xFFC0)) // -/w: low part of polynomial
-#define CRC_POLY_HI (*(REG16 0xFFC2)) // -/w: high part of polynomial
-#define CRC_CRC16IN (*(REG16 0xFFC4)) // -/w: input for CRC16
-#define CRC_CRC32IN (*(REG16 0xFFC6)) // -/w: input for CRC32
-//#define ??? (*(REG16 0xFFC8)) // -/-: reserved
-//#define ??? (*(REG16 0xFFCA)) // -/-: reserved
-#define CRC_RESX (*(REG16 0xFFCC)) // r/w: crc shift register low
-#define CRC_RESY (*(REG16 0xFFCE)) // r/w: crc shift register high
-
-#define CRC_POLY32bit (*(REG32 (&CRC_POLY_LO))) // -/w: write polynomial as 32-bit data word
-#define CRC_R32bit (*(REG32 (&CRC_RESX))) // r/w: crc shift register as 32-bit data word
-
-
-// ----------------------------------------------------------------------------
-// Custom Functions Unit (CFU)
-// ----------------------------------------------------------------------------
-#define CFU_REG0 (*(REG16 0xFFD0)) // r/w: user defined...
-#define CFU_REG1 (*(REG16 0xFFD2)) // r/w: user defined...
-#define CFU_REG2 (*(REG16 0xFFD4)) // r/w: user defined...
-#define CFU_REG3 (*(REG16 0xFFD6)) // r/w: user defined...
-#define CFU_REG4 (*(REG16 0xFFD8)) // r/w: user defined...
-#define CFU_REG5 (*(REG16 0xFFDA)) // r/w: user defined...
-#define CFU_REG6 (*(REG16 0xFFDC)) // r/w: user defined...
-#define CFU_REG7 (*(REG16 0xFFDE)) // r/w: user defined...
-
-
-// ----------------------------------------------------------------------------
-// Pulse Width Modulation Controller (PWM)
-// ----------------------------------------------------------------------------
-#define PWM_CT (*(REG16 0xFFE0)) // -/w: control register
-#define PWM_CH10 (*(REG16 0xFFE2)) // r/w: duty cycle channel 1 and 0
-#define PWM_CH32 (*(REG16 0xFFE4)) // r/w: duty cycle channel 3 and 2
-
-// PWM controller control register
-#define PWM_CT_EN 0 // -/w: PWM enable
-#define PWM_CT_PRSC0 1 // -/w: clock prescaler select bit 0
-#define PWM_CT_PRSC1 2 // -/w: clock prescaler select bit 1
-#define PWM_CT_PRSC2 3 // -/w: clock prescaler select bit 2
-#define PWM_CT_SIZE0 4 // -/w: PWM counter size bit 0
-#define PWM_CT_SIZE1 5 // -/w: PWM counter size bit 1
-#define PWM_CT_SIZE2 6 // -/w: PWM counter size bit 2
-
-// PWM clock prescaler select:
-#define PWM_PRSC_2 0 // CLK/2
-#define PWM_PRSC_4 1 // CLK/4
-#define PWM_PRSC_8 2 // CLK/8
-#define PWM_PRSC_64 3 // CLK/64
-#define PWM_PRSC_128 4 // CLK/128
-#define PWM_PRSC_1024 5 // CLK/1024
-#define PWM_PRSC_2048 6 // CLK/2048
-#define PWM_PRSC_4096 7 // CLK/4096
-
-
-// ----------------------------------------------------------------------------
-// Two Wire Serial Interface (TWI)
-// ----------------------------------------------------------------------------
-#define TWI_CT (*(REG16 0xFFE8)) // r/w: control register
-#define TWI_DATA (*(REG16 0xFFEA)) // r/w: RX (r) / TX (w) data
-
-// TWI control register
-#define TWI_CT_EN 0 // r/w: TWI enable
-#define TWI_CT_START 1 // -/w: generate START condition
-#define TWI_CT_STOP 2 // -/w: generate STOP condition
-#define TWI_CT_BUSY 3 // r/-: TWI busy
-#define TWI_CT_PRSC0 4 // r/w: clock prescaler select bit 0
-#define TWI_CT_PRSC1 5 // r/w: clock prescaler select bit 1
-#define TWI_CT_PRSC2 6 // r/w: clock prescaler select bit 2
-#define TWI_CT_IRQ_EN 7 // r/w: transmission done interrupt enable
-
-// TWI clock prescaler select:
-#define TWI_PRSC_2 0 // CLK/2
-#define TWI_PRSC_4 1 // CLK/4
-#define TWI_PRSC_8 2 // CLK/8
-#define TWI_PRSC_64 3 // CLK/64
-#define TWI_PRSC_128 4 // CLK/128
-#define TWI_PRSC_1024 5 // CLK/1024
-#define TWI_PRSC_2048 6 // CLK/2048
-#define TWI_PRSC_4096 7 // CLK/4096
-
-// TWI data register flags
-#define TWI_DT_ACK 15 // r/-: ACK received
-
-
-// ----------------------------------------------------------------------------
-// Reserved
-// ----------------------------------------------------------------------------
-//#define TRNG_DATA (*(REG16 0xFFEC))
-//#define TRNG_DATA (*(REG16 0xFFEE))
-
-
-// ----------------------------------------------------------------------------
-// System Configuration (SYSCONFIG)
-// ----------------------------------------------------------------------------
-#define CPUID0 (*(ROM16 0xFFF0)) // r/-: HW version
-#define CPUID1 (*(ROM16 0xFFF2)) // r/-: system configuration
-#define CPUID2 (*(ROM16 0xFFF4)) // r/-: CPU identifier
-#define CPUID3 (*(ROM16 0xFFF6)) // r/-: IMEM/ROM size in bytes
-#define CPUID4 (*(ROM16 0xFFF8)) // r/-: DMEM/RAM base address
-#define CPUID5 (*(ROM16 0xFFFA)) // r/-: DMEM/RAM size in bytes
-#define CPUID6 (*(ROM16 0xFFFC)) // r/-: clock speed lo
-#define CPUID7 (*(ROM16 0xFFFE)) // r/-: clock speed hi
-
-// Aliases
-#define HW_VERSION CPUID0 // r/-: HW version number
-#define SYS_FEATURES CPUID1 // r/-: synthesized system features
-#define USER_CODE CPUID2 // r/-: custom user code
-#define IMEM_SIZE CPUID3 // r/-: IMEM/ROM size in bytes
-#define DMEM_BASE CPUID4 // r/-: DMEM/RAM base address
-#define DMEM_SIZE CPUID5 // r/-: DMEM/RAM size in bytes
-#define CLOCKSPEED_LO CPUID6 // r/-: clock speed (in Hz) low part
-#define CLOCKSPEED_HI CPUID7 // r/-: clock speed (in Hz) high part
-
-// SysConfig - 32-bit register access
-#define CLOCKSPEED_32bit (*(REG32 (&CLOCKSPEED_LO))) // r/-: clock speed (in Hz)
-
-// SYS features
-#define SYS_MULDIV_EN 0 // MULDIV synthesized
-#define SYS_WB32_EN 1 // WB32 synthesized
-#define SYS_WDT_EN 2 // WDT synthesized
-#define SYS_GPIO_EN 3 // GPIO synthesized
-#define SYS_TIMER_EN 4 // timer synthesized
-#define SYS_UART_EN 5 // UART synthesized
-#define SYS_DADD_EN 6 // DADD instruction synthesized
-#define SYS_BTLD_EN 7 // Bootloader installed and enabled?
-#define SYS_IROM_EN 8 // Implement IMEM as true ROM?
-#define SYS_CRC_EN 9 // CRC synthesized
-#define SYS_CFU_EN 10 // CFU synthesized
-#define SYS_PWM_EN 11 // PWM controller synthesized
-#define SYS_TWI_EN 12 // TWI synthesized
-#define SYS_SPI_EN 13 // SPI synthesized
-
-
-// ----------------------------------------------------------------------------
-// Include all IO library headers
-// ----------------------------------------------------------------------------
-#include "neo430_aux.h"
-#include "neo430_cpu.h"
-#include "neo430_crc.h"
-#include "neo430_gpio.h"
-#include "neo430_muldiv.h"
-#include "neo430_pwm.h"
-#include "neo430_spi.h"
-#include "neo430_twi.h"
-#include "neo430_uart.h"
-#include "neo430_wdt.h"
-#include "neo430_wishbone.h"
-
-
-#endif // neo430_h
Index: trunk/sw/common/neo430_linker_script.x
===================================================================
--- trunk/sw/common/neo430_linker_script.x (revision 167)
+++ trunk/sw/common/neo430_linker_script.x (nonexistent)
@@ -1,233 +0,0 @@
-/* ################################################################################################# */
-/* # < NEO430 MSP430GCC linker script > # */
-/* # ********************************************************************************************* # */
-/* # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 # */
-/* # Copyright by Stephan Nolting: stnolting@gmail.com # */
-/* # # */
-/* # This source file may be used and distributed without restriction provided that this copyright # */
-/* # statement is not removed from the file and that any derivative work contains the original # */
-/* # copyright notice and the associated disclaimer. # */
-/* # # */
-/* # This source file is free software; you can redistribute it and/or modify it under the terms # */
-/* # of the GNU Lesser General Public License as published by the Free Software Foundation, # */
-/* # either version 3 of the License, or (at your option) any later version. # */
-/* # # */
-/* # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; # */
-/* # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # */
-/* # See the GNU Lesser General Public License for more details. # */
-/* # # */
-/* # You should have received a copy of the GNU Lesser General Public License along with this # */
-/* # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html # */
-/* # ********************************************************************************************* # */
-/* # Stephan Nolting, Hannover, Germany 01.03.2019 # */
-/* ################################################################################################# */
-
-OUTPUT_ARCH(msp430)
-
-
-/* Relevant address space layout */
-MEMORY
-{
- rom (rx) : ORIGIN = 0x0000, LENGTH = 0x1000
- ram (rwx) : ORIGIN = 0xC008, LENGTH = 0x0800 - 8
-}
-
-/* Final executable layout */
-SECTIONS
-{
- .text :
- {
- . = ALIGN(2);
- PROVIDE(__text_start = .);
- PROVIDE(__textstart = .);
-
- KEEP(crt0.elf(.text)); /* start-up/termination code */
-
- *(.init .init.*);
- *(.init0); /* Start here after reset. */
- *(.init1); /* User definable */
- *(.init2); /* Initialize stack */
- *(.init3); /* Initialize hardware */
- *(.init4); /* Copy data to .data, clear bss */
- *(.init5); /* User definable. */
- *(.init6); /* C++ constructors. */
- *(.init7); /* User definable. */
- *(.init8); /* User definable. */
- *(.init9); /* Call main(). */
-
- *(.fini9); /* Falls into here after main(). User definable. */
- *(.fini8); /* User definable. */
- *(.fini7); /* User definable. */
- *(.fini6); /* C++ destructors. */
- *(.fini5); /* User definable. */
- *(.fini4); /* User definable. */
- *(.fini3); /* User definable. */
- *(.fini2); /* User definable. */
- *(.fini1); /* User definable. */
- *(.fini0); /* Infinite loop after program termination. */
- *(.fini .fini.*);
-
- . = ALIGN(2);
- __ctors_start = .;
- KEEP(*(.ctors));
- __ctors_end = .;
- __dtors_start = .;
- KEEP(*(.dtors));
- __dtors_end = .;
-
- . = ALIGN(2);
- *(.text .text.*);
- *(.near.text .near.text.*);
-
- . = ALIGN(2);
- PROVIDE(__text_end = .);
- PROVIDE(__textend = .);
- } > rom
-
- .rodata :
- {
- . = ALIGN(2);
- PROVIDE(__rodata_start = .);
- PROVIDE(__rodatastart = .);
-
- *(.plt);
- . = ALIGN(2);
- *(.lower.rodata.* .lower.rodata)
- . = ALIGN(2);
- *(.rodata .rodata.* .gnu.linkonce.r.* .const .const:*)
- . = ALIGN(2);
- *(.either.rodata.* .either.rodata)
- . = ALIGN(2);
- *(.rodata1)
- . = ALIGN(2);
-
- KEEP (*(.gcc_except_table)) *(.gcc_except_table.*)
- PROVIDE (__preinit_array_start = .);
- KEEP (*(.preinit_array))
- PROVIDE (__preinit_array_end = .);
- PROVIDE (__init_array_start = .);
- KEEP (*(SORT(.init_array.*)))
- KEEP (*(.init_array))
- PROVIDE (__init_array_end = .);
- PROVIDE (__fini_array_start = .);
- KEEP (*(.fini_array))
- KEEP (*(SORT(.fini_array.*)))
- PROVIDE (__fini_array_end = .);
-
- PROVIDE(__rodata_end = .);
- PROVIDE(__rodataend = .);
- } > rom
- _etext = .; /* Past last read-only (loadable) segment */
-
- /* ----------------------------------- */
-
- .data :
- {
- . = ALIGN(2);
- PROVIDE(__data_start = .);
- PROVIDE(__datastart = .);
-
- *(.lower.data.* .lower.data)
- *(.data .data.* .gnu.linkonce.d.*)
- *(.either.data.* .either.data)
-
- KEEP (*(.jcr))
- *(.data.rel.ro.local) *(.data.rel.ro*)
- *(.dynamic)
-
- KEEP (*(.gnu.linkonce.d.*personality*))
- SORT(CONSTRUCTORS)
- *(.data1)
- *(.got.plt) *(.got)
-
- . = ALIGN(2);
- *(.sdata .sdata.* .gnu.linkonce.s.* D_2 D_1)
-
- . = ALIGN(2);
- _edata = .;
- PROVIDE(edata = .);
- PROVIDE(__data_end = .);
- PROVIDE(__dataend = .);
- } > ram AT > rom
-
- /* ----------------------------------- */
-
- .bss :
- {
- . = ALIGN(2);
- PROVIDE(__bss_start = .);
- PROVIDE(__bssstart = .);
-
- *(.lower.bss.* .lower.bss)
- *(.dynbss);
- *(.sbss .sbss.*);
- *(.bss .bss.* .gnu.linkonce.b.*);
- *(.either.bss.* .either.bss)
- . = ALIGN(2);
- *(COMMON);
- . = ALIGN(2);
-
- PROVIDE(__bss_end = .);
- PROVIDE(__bssend = .);
- } > ram
-
- .noinit (NOLOAD):
- {
- . = ALIGN(2);
- *(.noinit)
- . = ALIGN(2);
- PROVIDE(__noinit_end = .);
- end = .;
- } > ram
-
- .MP430.attributes 0 :
- {
- KEEP (*(.MSP430.attributes))
- KEEP (*(.gnu.attributes))
- KEEP (*(__TI_build_attributes))
- }
-
- /* The rest are all not normally part of the runtime image. */
-
- /* Stabs debugging sections. */
- .stab 0 : { *(.stab) }
- .stabstr 0 : { *(.stabstr) }
- .stab.excl 0 : { *(.stab.excl) }
- .stab.exclstr 0 : { *(.stab.exclstr) }
- .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
- .comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
- /* DWARF 1 */
- .debug 0 : { *(.debug) }
- .line 0 : { *(.line) }
- /* GNU DWARF 1 extensions */
- .debug_srcinfo 0 : { *(.debug_srcinfo) }
- .debug_sfnames 0 : { *(.debug_sfnames) }
- /* DWARF 1.1 and DWARF 2 */
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
- .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
- .debug_frame 0 : { *(.debug_frame) }
- .debug_str 0 : { *(.debug_str) }
- .debug_loc 0 : { *(.debug_loc) }
- .debug_macinfo 0 : { *(.debug_macinfo) }
- /* SGI/MIPS DWARF 2 extensions */
- .debug_weaknames 0 : { *(.debug_weaknames) }
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
- /DISCARD/ : { *(.note.GNU-stack) }
-
-PROVIDE(__data_start_rom = _etext);
-PROVIDE(__data_end_rom = _etext + SIZEOF(.data));
-PROVIDE(__romdatastart = __data_start_rom);
-PROVIDE(__romdatacopysize = SIZEOF(.data));
-PROVIDE(__bsssize = SIZEOF(.bss));
-
-}
Index: trunk/sw/common/crt0.asm
===================================================================
--- trunk/sw/common/crt0.asm (revision 167)
+++ trunk/sw/common/crt0.asm (nonexistent)
@@ -1,129 +0,0 @@
-; #################################################################################################
-; # < crt0.asm - general neo430 application start-up code > #
-; # ********************************************************************************************* #
-; # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-; # Copyright by Stephan Nolting: stnolting@gmail.com #
-; # #
-; # This source file may be used and distributed without restriction provided that this copyright #
-; # statement is not removed from the file and that any derivative work contains the original #
-; # copyright notice and the associated disclaimer. #
-; # #
-; # This source file is free software; you can redistribute it and/or modify it under the terms #
-; # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-; # either version 3 of the License, or (at your option) any later version. #
-; # #
-; # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-; # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-; # See the GNU Lesser General Public License for more details. #
-; # #
-; # You should have received a copy of the GNU Lesser General Public License along with this #
-; # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-; # ********************************************************************************************* #
-; # Stephan Nolting, Hannover, Germany 06.04.2019 #
-; #################################################################################################
-
- .file "crt0.asm"
- .section .text
- .p2align 1,0
-
-__crt0_begin:
-; -----------------------------------------------------------
-; Get required system info
-; -----------------------------------------------------------
- mov &0xFFF8, r8 ; = DMEM (RAM) base address
- mov &0xFFFA, r1 ; = DMEM (RAM) size in byte
-
-
-; -----------------------------------------------------------
-; Minimal required hardware setup
-; -----------------------------------------------------------
- mov #0, r2 ; clear status register & disable interrupts
- add r8, r1 ; r1 = stack pointer = end of RAM
- sub #2, r1 ; address of last entry of stack
- mov #0x4700, &0xFFB8 ; deactivate watchdog
-
-
-; -----------------------------------------------------------
-; Initialize all IO device registers (set to zero)
-; -----------------------------------------------------------
-; This loop does not trigger any operations as the CTRL registers, which are located
-; at offset 0 of the according device, are set to zero resulting in disabling the
-; specific device.
- mov #0xFF80, r9 ; beginning of IO section
-__crt0_clr_io:
- tst r9 ; until the end -> wrap-around to 0
- jeq __crt0_clr_io_end
- mov #0, 0(r9) ; clear entry
- incd r9
- jmp __crt0_clr_io
-__crt0_clr_io_end:
-
-
-; -----------------------------------------------------------
-; Clear complete DMEM (including .bss section)
-; -----------------------------------------------------------
-__crt0_clr_dmem:
- cmp r8, r1 ; base address equal to end of RAM?
- jeq __crt0_clr_dmem_end
- mov #0, 0(r8) ; clear entry
- incd r8
- jmp __crt0_clr_dmem
-__crt0_clr_dmem_end:
-
-
-; -----------------------------------------------------------
-; Copy initialized .data section from ROM to RAM
-; -----------------------------------------------------------
- mov #__data_start_rom, r5
- mov #__data_end_rom, r6
- mov #__data_start, r7
-__crt0_cpy_data:
- cmp r5, r6
- jeq __crt0_cpy_data_end
- mov @r5+, 0(r7)
- incd r7
- jmp __crt0_cpy_data
-__crt0_cpy_data_end:
-
-
-; -----------------------------------------------------------
-; Re-init SR and clear all pending IRQs from buffer
-; -----------------------------------------------------------
- mov #(1<<14), r2 ; this flag auto clears
-
-
-; -----------------------------------------------------------
-; Initialize all remaining registers
-; -----------------------------------------------------------
- mov #0, r4
-; mov #0, r5 ; -- is already initialized
-; mov #0, r6 ; -- is already initialized
-; mov #0, r7 ; -- is already initialized
-; mov #0, r8 ; -- is already initialized
-; mov #0, r9 ; -- is already initialized
- mov #0, r10
- mov #0, r11
- mov #0, r12 ; set argc = 0
- mov #0, r13
- mov #0, r14
- mov #0, r15
-
-
-; -----------------------------------------------------------
-; This is where the actual application is started
-; -----------------------------------------------------------
-__crt0_start_main:
- call #main
-
-
-; -----------------------------------------------------------
-; Go to endless sleep mode if main returns
-; -----------------------------------------------------------
-__crt0_this_is_the_end:
- mov #0, r2 ; deactivate IRQs
- mov #0x4700, &0xFFB8 ; deactivate watchdog
- mov #(1<<4), r2 ; set CPU to sleep mode
- nop
-
-.Lfe0:
- .size __crt0_begin, .Lfe0-__crt0_begin
Index: trunk/sw/bootloader/makefile
===================================================================
--- trunk/sw/bootloader/makefile (revision 167)
+++ trunk/sw/bootloader/makefile (nonexistent)
@@ -1,169 +0,0 @@
-#################################################################################################
-# < NEO430 BOOTLOADER Compile Script - Linux / Cygwin / Windows Subsystem for Linux version > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (append all additional files here)
-APP_SRC = bootloader.c
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_ASM = bootloader.s
-
-all: $(APP_ASM) neo430_bootloader_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: boot_crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) -T boot_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .image -O binary $@
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable VHDL boot image
-neo430_bootloader_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -bld_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_bootloader_image.vhd
- @cp neo430_bootloader_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_bootloader_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Targets:"
- @echo " help - show this text"
- @echo " all - compile and generate VHDL boot image and *.bin executable for upload via bootloader"
- @echo " clean - clean up this project only"
- @echo " clean_all - clean up everything"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/bootloader/boot_linker_script.x
===================================================================
--- trunk/sw/bootloader/boot_linker_script.x (revision 167)
+++ trunk/sw/bootloader/boot_linker_script.x (nonexistent)
@@ -1,70 +0,0 @@
-/* ################################################################################################# */
-/* # < NEO430 MSP430GCC bootloader linker script > # */
-/* # ********************************************************************************************* # */
-/* # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 # */
-/* # Copyright by Stephan Nolting: stnolting@gmail.com # */
-/* # # */
-/* # This source file may be used and distributed without restriction provided that this copyright # */
-/* # statement is not removed from the file and that any derivative work contains the original # */
-/* # copyright notice and the associated disclaimer. # */
-/* # # */
-/* # This source file is free software; you can redistribute it and/or modify it under the terms # */
-/* # of the GNU Lesser General Public License as published by the Free Software Foundation, # */
-/* # either version 3 of the License, or (at your option) any later version. # */
-/* # # */
-/* # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; # */
-/* # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # */
-/* # See the GNU Lesser General Public License for more details. # */
-/* # # */
-/* # You should have received a copy of the GNU Lesser General Public License along with this # */
-/* # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html # */
-/* # ********************************************************************************************* # */
-/* # Stephan Nolting, Hannover, Germany 19.07.2019 # */
-/* ################################################################################################# */
-
-OUTPUT_ARCH(msp430)
-
-
-/* Address space layout - only the boot rom size is required here */
-MEMORY
-{
- boot_rom (rx) : ORIGIN = 0xF000, LENGTH = 0x0800
-}
-
-/* Final executable layout */
-SECTIONS
-{
- .image :
- {
- . = ALIGN(2);
- KEEP(crt0.elf(.text));
-
- . = ALIGN(2);
- *(.text .text.*);
- *(.near.text .near.text.*);
-
- . = ALIGN(2);
- *(.rodata .rodata.*);
- *(.data .data.*);
- *(.sdata .sdata.*);
-
-
- /* Unused but required by some pre-defined toolchain objects */
- PROVIDE(__romdatastart = .);
- PROVIDE(__bsssize = 0);
- PROVIDE(__romdatacopysize = 0);
- PROVIDE(__crt0_init_bss = 0);
- PROVIDE(__bssstart = 0);
- PROVIDE(__datastart = 0);
- PROVIDE(__crt0_movedata = 0);
- PROVIDE(__crt0_run_init_array = 0);
- PROVIDE(__crt0_run_fini_array = 0);
- PROVIDE(__fini_array_start = 0);
- PROVIDE(__fini_array_end = 0);
- PROVIDE(__init_array_start = 0);
- PROVIDE(__init_array_end = 0);
- PROVIDE(__preinit_array_start = 0);
- PROVIDE(__preinit_array_end = 0);
-
- } > boot_rom
-}
Index: trunk/sw/bootloader/boot_crt0.asm
===================================================================
--- trunk/sw/bootloader/boot_crt0.asm (revision 167)
+++ trunk/sw/bootloader/boot_crt0.asm (nonexistent)
@@ -1,44 +0,0 @@
-; #################################################################################################
-; # < boot_crt0.asm - neo430 bootloader start-up code > #
-; # ********************************************************************************************* #
-; # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-; # Copyright by Stephan Nolting: stnolting@gmail.com #
-; # #
-; # This source file may be used and distributed without restriction provided that this copyright #
-; # statement is not removed from the file and that any derivative work contains the original #
-; # copyright notice and the associated disclaimer. #
-; # #
-; # This source file is free software; you can redistribute it and/or modify it under the terms #
-; # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-; # either version 3 of the License, or (at your option) any later version. #
-; # #
-; # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-; # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-; # See the GNU Lesser General Public License for more details. #
-; # #
-; # You should have received a copy of the GNU Lesser General Public License along with this #
-; # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-; # ********************************************************************************************* #
-; # Stephan Nolting, Hannover, Germany 06.04.2019 #
-; #################################################################################################
-
- .file "boot_crt0.asm"
- .section .text
- .p2align 1,0
-
-__boot_crt0:
-; -----------------------------------------------------------
-; Minimal required hardware setup
-; -----------------------------------------------------------
- mov &0xFFF8, r1 ; DMEM (RAM) base address
- add &0xFFFA, r1 ; add DMEM (RAM) size in bytes to SP
- sub #2, r1 ; address of last entry of stack
-
-
-; -----------------------------------------------------------
-; This is where the actual application is started
-; -----------------------------------------------------------
- jmp main ; do a simple jump, as we will not return here
-
-.Lfe0:
- .size __boot_crt0,.Lfe0-__boot_crt0
Index: trunk/sw/bootloader/bootloader.c
===================================================================
--- trunk/sw/bootloader/bootloader.c (revision 167)
+++ trunk/sw/bootloader/bootloader.c (nonexistent)
@@ -1,499 +0,0 @@
-// #################################################################################################
-// # < NEO430 Bootloader > #
-// # ********************************************************************************************* #
-// # Boot from IMEM, UART or SPI EEPROM at SPI.CS[0] #
-// # #
-// # UART configuration: 8N1 at 19200 baud #
-// # Boot EEPROM: SPI, 16-bit addresses (e.g., 25LC512) @ SPI.CS[0] #
-// # GPIO.out[0] is used as high-active status LED #
-// # #
-// # Auto boot sequence after timeout: #
-// # -> Try booting from SPI EEPROM at SPI.CS[0] #
-// # -> permanently light up status led and freeze if SPI EEPROM booting attempt fails #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 19.09.2019 #
-// #################################################################################################
-
-// Libraries
-#include
-#include
-
-// Macros
-#define xstr(a) str(a)
-#define str(a) #a
-
-// Configuration
-#define BAUD_RATE 19200 // default UART baud rate
-#define AUTOBOOT_TIMEOUT 8 // countdown (seconds) to auto boot
-#define STATUS_LED 0 // GPIO.out(0) is status LED
-
-// 25LC512 EEPROM
-#define BOOT_EEP_CS 0 // boot EEPROM CS (SPI.CS0)
-#define EEP_IMAGE_BASE 0x00 // base address of NEO430 boot image
-#define EEP_WRITE 0x02 // initialize start of write sequence
-#define EEP_READ 0x03 // initialize start of read sequence
-#define EEP_RDSR 0x05 // read status register
-#define EEP_WREN 0x06 // write enable
-
-// Image sources
-#define UART_IMAGE 0x00
-#define EEPROM_IMAGE 0x01
-
-// Error codes
-#define ERROR_EEPROM 0x00 // EEPROM access error
-#define ERROR_ROMACCESS 0x01 // cannot write to IMEM
-#define ERROR_EXECUTABLE 0x02 // invalid executable format
-#define ERROR_SIZE 0x04 // executable is too big
-#define ERROR_CHECKSUM 0x08 // checksum error
-#define ERROR_EEPWR 0xFF // EEPROM write error
-
-// Scratch registers - abuse unused IRQ vectors for this ;)
-#define TIMEOUT_CNT IRQVEC_GPIO
-
-// Function prototypes
-void __attribute__((__interrupt__)) timer_irq_handler(void);
-void __attribute__((__naked__)) start_app(void);
-void print_help(void);
-void core_dump(void);
-void store_eeprom(void);
-void eeprom_write_word(uint16_t a, uint16_t d);
-void eeprom_write_byte(uint16_t a, uint8_t b);
-uint8_t eeprom_read_byte(uint16_t a);
-void get_image(uint8_t src);
-uint16_t get_image_word(uint16_t a, uint8_t src);
-void __attribute__((__naked__)) system_error(uint8_t err_code);
-
-
-/* ------------------------------------------------------------
- * INFO Bootloader main
- * ------------------------------------------------------------ */
-int main(void) {
-
- // ****************************************************************
- // Processor hardware initialization
- // ****************************************************************
-
- // stack setup
- // -> done in boot_crt0
-
- // disable watchdog timer
- neo430_wdt_disable();
-
- // clear status register and disable interrupts, clear interrupt buffer, enable write access to IMEM
- asm volatile ("mov %0, r2" : : "i" ((1<> 14; // divide by 4096
- TMR_THRES = (CLOCKSPEED_HI << 2) -1; // "fake" ;D
- // enable timer, auto reset, enable IRQ, prsc = 1:2^16
- TMR_CT = (1< enter user console
- if ((UART_RTX & (1< ");
- char c = neo430_uart_getc();
- neo430_uart_putc(c); // echo
- neo430_uart_br_print("\n");
-
- if (c == 'r') // restart bootloader
- asm volatile ("mov #0xF000, r0"); // jump to beginning of bootloader ROM
- else if (c == 'h') // help menu
- print_help();
- else if (c == 'd') // core dump
- core_dump();
- else if (c == 'u') // upload program to RAM via UART
- get_image(UART_IMAGE);
- else if (c == 'p') // program EEPROM from RAM
- store_eeprom();
- else if (c == 'e') // copy program from EEPROM to RAM
- get_image(EEPROM_IMAGE);
- else if (c == 's') // start program in RAM
- start_app();
- else // unknown command
- neo430_uart_br_print("Bad CMD!");
- }
-}
-
-
-/* ------------------------------------------------------------
- * INFO Timer IRQ handler
- * ------------------------------------------------------------ */
-void __attribute__((__interrupt__)) timer_irq_handler(void) {
-
- TIMEOUT_CNT++; // increment system ticker
- neo430_gpio_port_toggle(1<> 8);
-
- eeprom_write_byte(a+0, hi);
- eeprom_write_byte(a+1, lo);
-}
-
-
-/* ------------------------------------------------------------
- * INFO EEPROM write single byte
- * PARAM a destination address (16 bit)
- * PARAM b byte to be written
- * ------------------------------------------------------------ */
-void eeprom_write_byte(uint16_t a, uint8_t b) {
-
- neo430_spi_cs_en(BOOT_EEP_CS);
- neo430_spi_trans(EEP_WREN); // write enable
- neo430_spi_cs_dis(BOOT_EEP_CS);
-
- neo430_spi_cs_en(BOOT_EEP_CS);
- neo430_spi_trans(EEP_WRITE); // byte write instruction
- neo430_spi_trans((uint8_t)(a >> 8));
- neo430_spi_trans((uint8_t)(a >> 0));
- neo430_spi_trans(b);
- neo430_spi_cs_dis(BOOT_EEP_CS);
-
- // wait for write to finish
- while(1) {
- neo430_spi_cs_en(BOOT_EEP_CS);
- neo430_spi_trans(EEP_RDSR); // read status register CMD
- uint8_t s = neo430_spi_trans(0x00);
- neo430_spi_cs_dis(BOOT_EEP_CS);
-
- if ((s & 0x01) == 0) { // check WIP flag
- break; // done!
- }
- }
-}
-
-
-/* ------------------------------------------------------------
- * INFO EEPROM read data
- * PARAM a destination address (16 bit)
- * RETURN byte read data
- * ------------------------------------------------------------ */
-uint8_t eeprom_read_byte(uint16_t a) {
-
- neo430_spi_cs_en(BOOT_EEP_CS);
- neo430_spi_trans(EEP_READ); // byte read instruction
- neo430_spi_trans((uint8_t)(a >> 8));
- neo430_spi_trans((uint8_t)(a >> 0));
- uint8_t d = neo430_spi_trans(0);
- neo430_spi_cs_dis(BOOT_EEP_CS);
-
- return d;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get IMEM image from SPI EEPROM at SPI.CS0 or from UART
- * PARAM src Image source 0: UART, 1: EEPROM
- * RETURN error code (0 if successful)
- * ------------------------------------------------------------ */
-void get_image(uint8_t src) {
-
- // abort if IMEM was implemented as true ROM
- if (SYS_FEATURES & (1< end)
- system_error(ERROR_SIZE);
-
- // transfer program data
- uint16_t *pnt = (uint16_t*)0x0000;
- uint16_t addr = 0x0006;
- uint16_t checksum = 0;
- uint16_t d = 0, i = 0;
- while (i < size/2) { // in words
- d = get_image_word(addr, src);
- checksum ^= d;
- *pnt++ = d;
- i++;
- addr += 2;
- }
-
- // clear rest of IMEM
- while(i < end/2) // in words
- pnt[i++] = 0x0000;
-
- // error during transfer?
- if (checksum == check) {
- neo430_uart_br_print("OK");
- }
- else
- system_error(ERROR_CHECKSUM);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get image word from EEPROM or UART
- * PARAM a source address (16 bit)
- * PARAM src: 0: UART, 1: EEPROM
- * RETURN accessed data word
- * ------------------------------------------------------------ */
-uint16_t get_image_word(uint16_t a, uint8_t src) {
-
- uint8_t c0 = 0, c1 = 0;
-
- // reads have to be consecutive when reading from the UART
- if (src == UART_IMAGE) { // get image data via UART
- c0 = (uint8_t)neo430_uart_getc();
- c1 = (uint8_t)neo430_uart_getc();
- }
- else { //if (src == EEPROM_IMAGE) // get image data from EEPROM
- c0 = eeprom_read_byte(a+0);
- c1 = eeprom_read_byte(a+1);
- }
-
- //uint16_t r = (((uint16_t)c0) << 8) | (((uint16_t)c1) << 0);
- uint16_t r = neo430_combine_bytes(c0, c1);
-
- return r;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Print error message, light up status LED and freeze system
- * INFO "naked" since this is final
- * PARAM error code
- * ------------------------------------------------------------ */
-void __attribute__((__naked__)) system_error(uint8_t err_code){
-
- neo430_uart_br_print("\a\nERR_");
- neo430_uart_print_hex_byte(err_code);
-
- asm volatile ("mov #0, r2"); // deactivate IRQs, no more write access to IMEM
- neo430_gpio_port_set(1< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 29.04.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define NUM_CELLS_X 160 // must be a multiple of 8
-#define NUM_CELLS_Y 40
-#define BAUD_RATE 19200
-
-// Global variables
-uint8_t universe[2][NUM_CELLS_X/8][NUM_CELLS_Y];
-
-// Prototypes
-void clear_universe(uint8_t u);
-void set_cell(uint8_t u, int16_t x, int16_t y);
-uint8_t get_cell(uint8_t u, int16_t x, int16_t y);
-uint8_t get_neighborhood(uint8_t u, int16_t x, int16_t y);
-void print_universe(uint8_t u);
-uint16_t pop_count(uint8_t u);
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- uint8_t u = 0, cell = 0, n = 0;
- int16_t x, y;
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
-
- // initialize universe
- uint32_t generation = 0;
- clear_universe(0);
- clear_universe(1);
-
- neo430_printf("\n\n### Conways's Game of Life ###\n\n");
- neo430_printf("This program requires a terminal resolution of at least %ux%u characters.\n", NUM_CELLS_X+2, NUM_CELLS_Y+3);
- neo430_printf("Press any key to start a random-initialized torus-style universe of %ux%u cells.\n", NUM_CELLS_X, NUM_CELLS_Y);
- neo430_printf("You can pause/restart the simulation by pressing any key.\n");
-
- // randomize until key pressed
- while (neo430_uart_char_received() == 0) {
- neo430_xorshift32();
- }
-
- // initialize universe using random data
- for (x=0; x= NUM_CELLS_X) || (y >= NUM_CELLS_Y))
- return; // out of range
-
- universe[u][x>>3][y] |= 1 << (7 - (x & 7));
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get state of cell
- * RETURN Cell state (DEAD or ALIVE)
- * ------------------------------------------------------------ */
-uint8_t get_cell(uint8_t u, int16_t x, int16_t y){
-
- // range check: wrap around -> torus-style universe
- if (x < 0)
- x = NUM_CELLS_X-1;
-
- if (x > NUM_CELLS_X-1)
- x = 0;
-
- if (y < 0)
- y = NUM_CELLS_Y-1;
-
- if (y > NUM_CELLS_Y-1)
- y = 0;
-
- // check bit according to cell
- uint8_t tmp = universe[u][x>>3][y];
- tmp &= 1 << (7 - (x & 7));
-
- if (tmp == 0)
- return 0;
- else
- return 1;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Get number of alive cells in direct neigborhood
- * RETURN Number of set cells in neigborhood
- * ------------------------------------------------------------ */
-uint8_t get_neighborhood(uint8_t u, int16_t x, int16_t y){
-
-// Cell index layout:
-// 012
-// 3#4
-// 567
-
- uint8_t num = 0;
- num += get_cell(u, x-1, y-1); // 0
- num += get_cell(u, x, y-1); // 1
- num += get_cell(u, x+1, y-1); // 2
- num += get_cell(u, x-1, y); // 3
- num += get_cell(u, x+1, y); // 4
- num += get_cell(u, x-1, y+1); // 5
- num += get_cell(u, x, y+1); // 6
- num += get_cell(u, x+1, y+1); // 7
-
- return num;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Population count
- * RETURN 16-bit number of living cells in universe u
- * ------------------------------------------------------------ */
-uint16_t pop_count(uint8_t u) {
-
- uint16_t x, y, cnt;
-
- cnt = 0;
- for (x=0; x #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/wdt_test/makefile
===================================================================
--- trunk/sw/example/wdt_test/makefile (revision 167)
+++ trunk/sw/example/wdt_test/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/wdt_test/main.c
===================================================================
--- trunk/sw/example/wdt_test/main.c (revision 167)
+++ trunk/sw/example/wdt_test/main.c (nonexistent)
@@ -1,84 +0,0 @@
-// #################################################################################################
-// # < Test program for the Watchdog Timer (WDT) > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // intro text
- neo430_uart_br_print("\n<<< Watchdog Test Program >>>\n\n");
-
- // check if WDT was synthesized, exit if no WDT is available
- if (!(SYS_FEATURES & (1< #
-// # ********************************************************************************************* #
-// # Translates a text string into Morse code. The encode can only encode letters. #
-// # Output via GPIO.output(0) (bootloader status LED). #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define MAX_STRING_LENGTH 128 // max length of plain morse text
-#define LED_PIN 0 // GPIO output pin #0
-#define TIME_PRSC 192
-#define BAUD_RATE 19200
-
-// Global vars
-uint32_t time_base;
-
-// Prototypes
-void send_morse(const char *s);
-
-// Morse alphabet (ASCII order)
-const char morse_code[][7] = {
- "--..--", // ,
- "-....-", // -
- ".-.-.-", // .
- "-..-.", // /
-
- "-----", // 0
- ".----", // 1
- "..---", // 2
- "...--", // 3
- "....-", // 4
- ".....", // 5
- "-....", // 6
- "--...", // 7
- "---..", // 8
- "----.", // 9
-
- "---...", // :
- "-.-.-.", // ;
- "", // < (not implemented)
- "-...-", // =
- "", // > (not implemented)
- "..--..", // ?
- "", // @ (not implemented)
-
- ".-", // A
- "-...", // B
- "-.-.", // C
- "-..", // D
- ".", // E
- "..-.", // F
- "--.", // G
- "....", // H
- "..", // I
- ".---", // J
- "-.-", // K
- ".-..", // L
- "--", // M
- "-.", // N
- "---", // O
- ".--.", // P
- "--.-", // Q
- ".-.", // R
- "...", // S
- "-", // T
- "..-", // U
- "...-", // V
- ".--", // W
- "-..-", // X
- "-.--", // Y
- "--..", // Z
-};
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- char buffer[MAX_STRING_LENGTH];
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // configure time base
- uint32_t clock = CLOCKSPEED_32bit;
- time_base = 0;
- while (clock >= TIME_PRSC) {
- clock = clock - TIME_PRSC;
- time_base++; // time base for a 'Dit'
- }
-
- neo430_uart_br_print("\n--- Morse code translator ---\n");
- neo430_uart_br_print("Enter a string to translate it to Morse code.\n");
- neo430_uart_br_print("Output via high-active LED at GPIO.out(0) (bootloader status LED).\n");
-
- // check if GPIO unit was synthesized, exit if no GPIO is available
- if (!(SYS_FEATURES & (1<= 'a') && (c <= 'z'))
- c -= 32;
-
- // in valid alphabet?
- if ((c >= ',') && (c <= 'Z')) {
- uint8_t index = c - ',';
- neo430_uart_br_print(" ");
- send_morse(morse_code[index]);
-
- uint32_t time = time_base * 3; // inter-letter pause
- while(time--)
- asm volatile ("nop");
-
- }
- // user abort?
- if (neo430_uart_char_received() != 0) {
- neo430_uart_br_print("\nAborted.");
- break;
- }
- }
-
- }
-
- return 0;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Send morse code via LED pin
- * PARAM *s pointer to source morse symbol string
- * ------------------------------------------------------------ */
-void send_morse(const char *s){
-
- char c = 0;
- uint32_t time = 0;
-
- while ((c = *s++)) {
-
- neo430_gpio_pin_set(LED_PIN); // LED on
-
- if (c == '.')
- time = time_base;
- else if (c == '-')
- time = time_base * 3;
- else
- time = 0;
-
- neo430_uart_putc(c);
-
- // wait
- while(time--)
- asm volatile ("nop");
-
- neo430_gpio_pin_clr(LED_PIN); // LED off
-
- // inter-symbol pause
- time = time_base;
- while(time--)
- asm volatile ("nop");
- }
-}
\ No newline at end of file
Index: trunk/sw/example/morse_translator/makefile
===================================================================
--- trunk/sw/example/morse_translator/makefile (revision 167)
+++ trunk/sw/example/morse_translator/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/muldiv_test/makefile
===================================================================
--- trunk/sw/example/muldiv_test/makefile (revision 167)
+++ trunk/sw/example/muldiv_test/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/muldiv_test/main.c
===================================================================
--- trunk/sw/example/muldiv_test/main.c (revision 167)
+++ trunk/sw/example/muldiv_test/main.c (nonexistent)
@@ -1,104 +0,0 @@
-// #################################################################################################
-// # < Test the multiplier/divider unit > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- neo430_printf("Multiplier/Divider Test\n\n");
-
- // check if multiplier/divider unit was synthesized, exit if not
- if (!(SYS_FEATURES & (1< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 10.10.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-#include
-
-// Prototypes
-void scan_twi(void);
-void set_speed(void);
-void send_twi(void);
-
-// Configuration
-#define BAUD_RATE 19200
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- char buffer[8];
- uint16_t length = 0;
-
- neo430_uart_br_print("\n---------------------------------\n"
- "--- TWI Bus Explorer Terminal ---\n"
- "---------------------------------\n\n");
-
- // check if TWI unit was synthesized, exit if no TWI is available
- if (!(SYS_FEATURES & (1< ");
- length = neo430_uart_scan(buffer, 8, 1);
- neo430_uart_br_print("\n");
-
- if (!length) // nothing to be done
- continue;
-
- // decode input and execute command
- if (!strcmp(buffer, "help")) {
- neo430_uart_br_print("Available commands:\n"
- " help - show this text\n"
- " scan - scan bus for devices\n"
- " start - generate START condition\n"
- " stop - generate STOP condition\n"
- " send - write/read single byte to/from bus\n"
- " speed - select bus clock\n"
- " reset - perform soft-reset\n"
- " exit - exit program and return to bootloader\n");
- }
- else if (!strcmp(buffer, "start")) {
- neo430_twi_generate_start(); // generate START condition
- }
- else if (!strcmp(buffer, "stop")) {
- neo430_twi_generate_stop(); // generate STOP condition
- }
- else if (!strcmp(buffer, "scan")) {
- scan_twi();
- }
- else if (!strcmp(buffer, "speed")) {
- set_speed();
- }
- else if (!strcmp(buffer, "send")) {
- send_twi();
- }
- else if (!strcmp(buffer, "reset")) {
- while ((UART_CT & (1<= 0) && (prsc < 8)) { // valid?
- TWI_CT = 0; // reset
- TWI_CT = (1 << TWI_CT_EN) | (prsc << TWI_CT_PRSC0);
- neo430_uart_br_print("\nDone.\n");
- }
- else {
- neo430_uart_br_print("\nInvalid selection!\n");
- return;
- }
-
- // print new clock frequency
- uint32_t clock = CLOCKSPEED_32bit;
- switch (prsc) {
- case 0: clock = clock / 2; break;
- case 1: clock = clock / 4; break;
- case 2: clock = clock / 8; break;
- case 3: clock = clock / 64; break;
- case 4: clock = clock / 128; break;
- case 5: clock = clock / 1024; break;
- case 6: clock = clock / 2048; break;
- case 7: clock = clock / 4096; break;
- default: clock = 0; break;
- }
- neo430_printf("New I2C clock: %n Hz\n", clock);
-}
-
-
-/* ------------------------------------------------------------
- * INFO Scan 7-bit TWI address space
- * ------------------------------------------------------------ */
-void scan_twi(void) {
-
- neo430_uart_br_print("Scanning TWI bus...\n");
- uint8_t i, num_devices = 0;
- for (i=0; i<128; i++) {
- uint8_t twi_ack = neo430_twi_start_trans((uint8_t)(2*i+1));
- neo430_twi_generate_stop();
-
- if (twi_ack == 0) {
- neo430_uart_br_print(" * Found device at address (shifted left by 1 bit): 0x");
- neo430_uart_print_hex_byte(2*i);
- neo430_uart_br_print("\n");
- num_devices++;
- }
- }
-
- if (!num_devices) {
- neo430_uart_br_print("No devices found.\n");
- }
-}
-
-
-/* ------------------------------------------------------------
- * INFO Read/write 1 byte from/to bus
- * ------------------------------------------------------------ */
-void send_twi(void) {
-
- char terminal_buffer[4];
-
- // enter data
- neo430_uart_br_print("Enter TX data (2 hex chars): ");
- neo430_uart_scan(terminal_buffer, 3, 1); // 2 hex chars for address plus '\0'
- uint8_t tmp = (uint8_t)neo430_hexstr_to_uint(terminal_buffer, strlen(terminal_buffer));
- uint8_t res = neo430_twi_trans(tmp);
- neo430_uart_br_print("\nRX data: 0x");
- neo430_uart_print_hex_byte(neo430_twi_get_data());
- neo430_uart_br_print("\nResponse: ");
- if (res == 0)
- neo430_uart_br_print("ACK\n");
- else
- neo430_uart_br_print("NACK\n");
-
-}
-
Index: trunk/sw/example/twi_test/makefile
===================================================================
--- trunk/sw/example/twi_test/makefile (revision 167)
+++ trunk/sw/example/twi_test/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/wb_terminal/makefile
===================================================================
--- trunk/sw/example/wb_terminal/makefile (revision 167)
+++ trunk/sw/example/wb_terminal/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/wb_terminal/main.c
===================================================================
--- trunk/sw/example/wb_terminal/main.c (revision 167)
+++ trunk/sw/example/wb_terminal/main.c (nonexistent)
@@ -1,346 +0,0 @@
-// #################################################################################################
-// # < Wishbone bus explorer > #
-// # ********************************************************************************************* #
-// # Manual access to the registers of modules, which are connected to the Wishbone bus. This tool #
-// # uses NONBLOCKING Wishbone transactions. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 10.10.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-#include
-
-// Global variables
-uint8_t wb_config = 0;
-
-// Prototypes
-void setup_wb(void);
-void read_wb_address(void);
-void write_wb_address(void);
-void dump_wb(void);
-
-// Configuration
-#define MAX_CMD_LENGTH 16
-#define BAUD_RATE 19200
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- char buffer[MAX_CMD_LENGTH];
- uint16_t length = 0;
- uint16_t selection = 0;
-
- neo430_uart_br_print("\n--------------------------------------\n"
- "--- Wishbone Bus Explorer Terminal ---\n"
- "--------------------------------------\n\n");
-
- // check if WB unit was synthesized, exit if no WB is available
- if (!(SYS_FEATURES & (1< ");
- length = neo430_uart_scan(buffer, MAX_CMD_LENGTH, 1);
- neo430_uart_br_print("\n");
-
- if (!length) // nothing to be done
- continue;
-
- // decode input
- selection = 0;
- if (!strcmp(buffer, "help"))
- selection = 1;
- if (!strcmp(buffer, "setup"))
- selection = 2;
- if (!strcmp(buffer, "read"))
- selection = 3;
- if (!strcmp(buffer, "write"))
- selection = 4;
- if (!strcmp(buffer, "dump"))
- selection = 5;
- if (!strcmp(buffer, "reset"))
- selection = 6;
- if (!strcmp(buffer, "exit"))
- selection = 7;
-
- // execute command
- switch(selection) {
-
- case 1: // print help menu
- neo430_uart_br_print("Available commands:\n"
- " help - show this text\n"
- " setup - configure WB interface\n"
- " read - read from WB address\n"
- " write - write to WB address\n"
- " dump - dump data from WB addresses\n"
- " reset - perform soft-reset\n"
- " exit - exit program and return to bootloader\n");
- break;
-
- case 2: // setup Wishbone adapter
- setup_wb();
- break;
-
- case 3: // read from address
- read_wb_address();
- break;
-
- case 4: // write to address
- write_wb_address();
- break;
-
- case 5: // dump data
- dump_wb();
- break;
-
- case 6: // restart
- while ((UART_CT & (1< #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: http://opencores.org/project,neo430 #
-// # Copyright 2015-2016, Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from http://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- char buffer[256];
-
- // CRC results were validated using http://crccalc.com/
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- neo430_uart_br_print("\n<<< CRC16/CRC32 module test >>>\n");
-
- // check if CRC unit was synthesized, exit if no WB is available
- if (!(SYS_FEATURES & (1<> 16));
- neo430_uart_print_hex_word((uint16_t)crc32_res);
-
- neo430_uart_br_print("\n");
- }
-
- return 0;
-}
-
Index: trunk/sw/example/crc_test/makefile
===================================================================
--- trunk/sw/example/crc_test/makefile (revision 167)
+++ trunk/sw/example/crc_test/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/prime_numbers/makefile
===================================================================
--- trunk/sw/example/prime_numbers/makefile (revision 167)
+++ trunk/sw/example/prime_numbers/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/prime_numbers/main.c
===================================================================
--- trunk/sw/example/prime_numbers/main.c (revision 167)
+++ trunk/sw/example/prime_numbers/main.c (nonexistent)
@@ -1,79 +0,0 @@
-// #################################################################################################
-// # < Computes and prints prime numbers > #
-// # ********************************************************************************************* #
-// # Computes all primes numbers between 3 and 2^32-1 using the harderr #
-// # approximation way ;) The printed numbers are formated using sprintf from #
-// # the C std library #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // intro text
- neo430_printf("\n\nGenerating prime numbers between 3 and %n", 0xFFFFFFFF);
- neo430_printf(".\n"
- "Press any key to start.\n"
- "You can abort the program by pressing any key again.\n");
-
- // wait for any key
- while(!neo430_uart_char_received());
-
- uint32_t n = 0, i = 0;
- uint8_t is_prime = 0;
-
- // generate candidates
- for (n=3; n!=0xFFFFFFFF; n+=2) {
-
- // check if prime
- is_prime = 1;
- for (i=2; i<=(n>>1); i++) {
- if (n%i == 0) {
- is_prime = 0;
- break;
- }
- }
-
- // output prime number in decimal representation
- if (is_prime)
- neo430_printf("%n, ", n);
-
- // abort?
- if (neo430_uart_char_received()) // any key input?
- neo430_soft_reset();
- }
-
- return 0;
-}
Index: trunk/sw/example/pwm_demo/makefile
===================================================================
--- trunk/sw/example/pwm_demo/makefile (revision 167)
+++ trunk/sw/example/pwm_demo/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/pwm_demo/main.c
===================================================================
--- trunk/sw/example/pwm_demo/main.c (revision 167)
+++ trunk/sw/example/pwm_demo/main.c (nonexistent)
@@ -1,90 +0,0 @@
-// #################################################################################################
-// # < PWM controller demo program > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: http://opencores.org/project,neo430 #
-// # Copyright 2015-2016, Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from http://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 20.04.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-#define PWM_MAX 63
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- neo430_uart_br_print("\n<<< PWM controller demo >>>\n");
-
- // check if PWM unit was synthesized, exit if no PWM controller is available
- if (!(SYS_FEATURES & (1< #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/gpio_interrupt/main.c
===================================================================
--- trunk/sw/example/gpio_interrupt/main.c (revision 167)
+++ trunk/sw/example/gpio_interrupt/main.c (nonexistent)
@@ -1,95 +0,0 @@
-// #################################################################################################
-// # < GPIO interrupt example program > #
-// # ********************************************************************************************* #
-// # Prints a message whenever a GPIO input pin goes HIGH. Uses the PIO pin-change interrupt. #
-// # Also outputs a counter on GPIO.OUT[7:0], driven by the timer interrupt. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 06.04.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-// Function prototypes
-void __attribute__((__interrupt__)) gpio_irq_handler(void);
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // intro text
- neo430_uart_br_print("\nGPIO pin change interrupt demo program\n\n");
-
- // check if GPIO & TIMER units present
- if (!(SYS_FEATURES & (1< #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/cfu_test/main.c
===================================================================
--- trunk/sw/example/cfu_test/main.c (revision 167)
+++ trunk/sw/example/cfu_test/main.c (nonexistent)
@@ -1,112 +0,0 @@
-// #################################################################################################
-// # < Custom Functions Unit Test Program > #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-// Prototypes
-void verify16(char *s, uint16_t a, uint16_t b);
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // intro text
- neo430_uart_br_print("\nCustom Functions Unit (CFU) test program\n");
-
- // check if CFU present
- if (!(SYS_FEATURES & (1< #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 01.01.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# Make defaults and targets
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.DEFAULT_GOAL := help
-
-TOPTARGETS := all clean_all
-
-SUBDIRS := $(wildcard */.)
-# ignore dummy folders (starting with '~')
-DUMMYDIRS := $(wildcard ~*/.)
-SUBDIRS := $(filter-out $(DUMMYDIRS), $(SUBDIRS))
-
-$(TOPTARGETS): $(SUBDIRS)
-$(SUBDIRS):
- @$(MAKE) -C $@ $(MAKECMDGOALS)
-
-.PHONY: $(TOPTARGETS) $(SUBDIRS)
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "Compile / clean up ALL project folders in this directory"
- @echo "Targets:"
- @echo " help - show this text"
- @echo " all - compile and install all projects"
- @echo " clean_all - clean up everything"
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/nested_irqs/main.c
===================================================================
--- trunk/sw/example/nested_irqs/main.c (revision 167)
+++ trunk/sw/example/nested_irqs/main.c (nonexistent)
@@ -1,129 +0,0 @@
-// #################################################################################################
-// # < Nested IRQs example > #
-// # ********************************************************************************************* #
-// # Generates a run time clock using the timer IRQ. #
-// # Whenever a char via the UART is received, the according ISR show the current time. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 20.04.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-#define CLOCK_FREQ 1000 // in Hz
-
-// Function prototypes
-void __attribute__((__interrupt__)) timer_irq_handler(void);
-void __attribute__((__interrupt__)) uart_irq_handler(void);
-
-// Variable
-volatile uint64_t time;
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
-
- // check if TIMER unit was synthesized, exit if no TIMER is available
- if (!(SYS_FEATURES & (1< #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/hw_analysis/makefile
===================================================================
--- trunk/sw/example/hw_analysis/makefile (revision 167)
+++ trunk/sw/example/hw_analysis/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/hw_analysis/main.c
===================================================================
--- trunk/sw/example/hw_analysis/main.c (revision 167)
+++ trunk/sw/example/hw_analysis/main.c (nonexistent)
@@ -1,158 +0,0 @@
-// #################################################################################################
-// # < Processor hardware analysis tool > #
-// # ********************************************************************************************* #
-// # Prints various information from the system. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 23.09.2019 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-// Prototypes
-void print_state(uint16_t d);
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // intro text
- neo430_printf("\nNEO430 Hardware Analysis Tool\n\n");
-
- // General information
- // --------------------------------------------
- // HW version
- neo430_printf("Hardware version: 0x%x\n", HW_VERSION);
-
- // HW user code
- neo430_printf("User code: 0x%x\n", USER_CODE);
-
- // Clock speed
- uint32_t clock = CLOCKSPEED_32bit;
- neo430_printf("Clock speed: %n Hz\n", clock);
-
- // ROM/IMEM
- neo430_printf("IMEM/ROM: %u bytes @ 0x0000\n", IMEM_SIZE);
-
- // RAM/DMEM
- neo430_printf("DMEM/RAM: %u bytes @ 0x%x\n", DMEM_SIZE, DMEM_BASE);
-
- // UART baud rate
- uint16_t baud = UART_CT & 0x00FF;
- uint16_t prsc;
- switch ((UART_CT >> 8) & 0x0007) {
- case 0: prsc = 2; break;
- case 1: prsc = 4; break;
- case 2: prsc = 8; break;
- case 3: prsc = 64; break;
- case 4: prsc = 128; break;
- case 5: prsc = 1024; break;
- case 6: prsc = 2048; break;
- case 7: prsc = 4096; break;
- default: prsc = 0; break;
- }
- uint32_t baud_value = clock / (uint32_t)(prsc * baud);
- neo430_printf("UART Baud rate: %n\n", baud_value);
-
-
- // System features
- // --------------------------------------------
- uint16_t ft = SYS_FEATURES;
- neo430_printf("\n\nSystem features\n");
- // CFU
- neo430_printf("- Multiplier/Divider: ");
- print_state(ft & (1< #
-// # ********************************************************************************************* #
-// # Displays an 8-bit counter on the high-active LEDs connected to the parallel output port. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // intro text
- neo430_uart_br_print("\nBlinking LED demo program\n");
-
- // check if GPIO unit was synthesized, exit if no GPIO is available
- if (!(SYS_FEATURES & (1< #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/uart_irq/main.c
===================================================================
--- trunk/sw/example/uart_irq/main.c (revision 167)
+++ trunk/sw/example/uart_irq/main.c (nonexistent)
@@ -1,190 +0,0 @@
-// #################################################################################################
-// # < UART interrupt example > #
-// # ********************************************************************************************* #
-// # UART RECEIVE is conducted using the UART RX interrupt #
-// # UART TRANSMIT is conducted by using the timer interrupt #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Configuration
-#define BAUD_RATE 19200
-#define UART_FIFO_SIZE 512 // must be a power of two!
-#define UART_FIFO_MASK (UART_FIFO_SIZE-1)
-
-// Types
-struct uart_fifo {
- uint8_t data[UART_FIFO_SIZE];
- uint16_t get_pnt;
- uint16_t put_pnt;
-};
-
-// Global vars
-volatile struct uart_fifo uart_rtx_fifo;
-
-// Function prototypes
-void __attribute__((__interrupt__)) uart_irq_handler(void);
-void __attribute__((__interrupt__)) timer_irq_handler(void);
-void __attribute__((__interrupt__)) gpio_irq_handler(void);
-
-void fifo_put_string(volatile struct uart_fifo *fifo, char *s);
-uint8_t fifo_put(volatile struct uart_fifo *fifo, uint8_t c);
-uint8_t fifo_get(volatile struct uart_fifo *fifo, uint8_t *c);
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
-
- // init fifo
- uart_rtx_fifo.get_pnt = 0;
- uart_rtx_fifo.put_pnt = 0;
-
- // deactivate all LEDs
- GPIO_OUTPUT = 0;
-
- // set address of UART, TIMER and GPIO IRQ handlers
- IRQVEC_SERIAL = (uint16_t)(&uart_irq_handler);
- IRQVEC_TIMER = (uint16_t)(&timer_irq_handler);
- IRQVEC_GPIO = (uint16_t)(&gpio_irq_handler);
-
- // configure GPIO pin-change interrupt
- GPIO_IRQMASK = 0xFFFF; // use all input pins as trigger
-
- // configure UART RX interrupt
- UART_CT |= (1<put_pnt + 1) & UART_FIFO_MASK);
-
- if (fifo->get_pnt == next)
- return 1; // fifo full
-
- fifo->data[fifo->put_pnt & UART_FIFO_MASK] = c;
- fifo->put_pnt = next;
-
- return 0;
-}
-
-
-/* ------------------------------------------------------------
- * INFO Read from buffer, returns 0 if success
- * ------------------------------------------------------------ */
-uint8_t fifo_get(volatile struct uart_fifo *fifo, uint8_t *c) {
-
- if (fifo->get_pnt == fifo->put_pnt)
- return 1; // fifo empty
-
- *c = fifo->data[fifo->get_pnt];
-
- fifo->get_pnt = (fifo->get_pnt+1) & UART_FIFO_MASK;
-
- return 0;
-}
-
-
-
-/* ------------------------------------------------------------
- * INFO GPIO pin-change interrupt handler
- * ------------------------------------------------------------ */
-void __attribute__((__interrupt__)) gpio_irq_handler(void) {
-
- GPIO_OUTPUT = (GPIO_OUTPUT + 1) & 0x00FF; // increment LED counter
-}
Index: trunk/sw/example/uart_irq/makefile
===================================================================
--- trunk/sw/example/uart_irq/makefile (revision 167)
+++ trunk/sw/example/uart_irq/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/timer_simple/makefile
===================================================================
--- trunk/sw/example/timer_simple/makefile (revision 167)
+++ trunk/sw/example/timer_simple/makefile (nonexistent)
@@ -1,188 +0,0 @@
-#################################################################################################
-# < NEO430 Application Compile Script - Linux / Windows Powershell / Windows Linux Subsystem > #
-# ********************************************************************************************* #
-# This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-# Copyright by Stephan Nolting: stnolting@gmail.com #
-# #
-# This source file may be used and distributed without restriction provided that this copyright #
-# statement is not removed from the file and that any derivative work contains the original #
-# copyright notice and the associated disclaimer. #
-# #
-# This source file is free software; you can redistribute it and/or modify it under the terms #
-# of the GNU Lesser General Public License as published by the Free Software Foundation, #
-# either version 3 of the License, or (at your option) any later version. #
-# #
-# This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-# See the GNU Lesser General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public License along with this #
-# source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-# ********************************************************************************************* #
-# Stephan Nolting, Hannover, Germany 04.10.2019 #
-#################################################################################################
-
-
-#-------------------------------------------------------------------------------
-# USER CONFIGURATION
-#-------------------------------------------------------------------------------
-# Compiler effort (-Os = optimize for size)
-EFFORT = -Os
-
-# User's application sources (add additional files here)
-APP_SRC = main.c
-
-# User's application include folders (don't forget the '-I' before each entry)
-APP_INC = -I .
-#-------------------------------------------------------------------------------
-
-
-
-#-------------------------------------------------------------------------------
-# NEO430 framework
-#-------------------------------------------------------------------------------
-# Path to NEO430 linker script and startup file
-NEO430_COM_PATH=../../common
-# Path to main NEO430 library include files
-NEO430_INC_PATH=../../lib/neo430/include
-# Path to main NEO430 library source files
-NEO430_SRC_PATH=../../lib/neo430/source
-# Path to NEO430 executable generator
-NEO430_EXE_PATH=../../tools/image_gen
-# Path to NEO430 core rtl folder
-NEO430_RTL_PATH=../../../rtl/core
-
-
-#-------------------------------------------------------------------------------
-# Add NEO430 sources to input SRCs
-#-------------------------------------------------------------------------------
-APP_SRC += $(wildcard $(NEO430_SRC_PATH)/*.c)
-
-
-#-------------------------------------------------------------------------------
-# Make defaults
-#-------------------------------------------------------------------------------
-.SUFFIXES:
-.PHONY: all
-.DEFAULT_GOAL := help
-
-
-#-------------------------------------------------------------------------------
-# Application output definitions
-#-------------------------------------------------------------------------------
-APP_BIN = main.bin
-APP_ASM = main.s
-
-compile: $(APP_ASM) $(APP_BIN)
-install: $(APP_ASM) neo430_application_image.vhd
-all: $(APP_ASM) $(APP_BIN) neo430_application_image.vhd
-
-# define all object files
-OBJ = $(APP_SRC:.c=.o)
-
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-#C ompiler tools
-AS = msp430-elf-as
-CC = msp430-elf-gcc
-LD = msp430-elf-ld
-STRIP = msp430-elf-strip
-OBJDUMP = msp430-elf-objdump
-OBJCOPY = msp430-elf-objcopy
-SIZE = msp430-elf-size
-IMAGE_GEN = $(NEO430_EXE_PATH)/image_gen
-
-# Compiler flags
-CC_OPTS = -mcpu=msp430 -pipe -Wall -Xassembler --mY -mhwmult=none -fno-delete-null-pointer-checks
-CC_OPTS += -Wl,-static -mrelax -minrt -nostartfiles -fdata-sections -ffunction-sections -Xlinker --gc-sections
-
-# Linker flags
-LD_OPTS = -mcpu=msp430 -Wl,--gc-sections -mrelax -minrt -nostartfiles
-
-
-#-------------------------------------------------------------------------------
-# PC Host Compiler
-#-------------------------------------------------------------------------------
-CC_X86 = g++ -Wall -O -g
-
-
-#-------------------------------------------------------------------------------
-# Tool Targets
-#-------------------------------------------------------------------------------
-# install/compile tools
-$(IMAGE_GEN): $(NEO430_EXE_PATH)/main.cpp
- @echo Compiling $(IMAGE_GEN)
- @$(CC_X86) $< -o $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# Application Targets
-#-------------------------------------------------------------------------------
-# Assemble startup code
-crt0.elf: $(NEO430_COM_PATH)/crt0.asm
- @$(AS) -mY -mcpu=msp430 $< -o $@
-
-# Compile app sources
-$(OBJ): %.o : %.c crt0.elf
- @$(CC) -c $(CC_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) $< -o $@
-
-# Link object files
-main.elf: $(OBJ)
- @$(CC) $(LD_OPTS) $(EFFORT) -I $(NEO430_INC_PATH) $(APP_INC) -T $(NEO430_COM_PATH)/neo430_linker_script.x $(OBJ) -o $@ -lm
- @echo Memory utilization:
- @$(SIZE) main.elf
-
-# Generate final executable (from .image section only)
-image.dat: main.elf
- @$(OBJCOPY) -I elf32-little $< -j .text -O binary text.dat
- @$(OBJCOPY) -I elf32-little $< -j .rodata -O binary rodata.dat
- @$(OBJCOPY) -I elf32-little $< -j .data -O binary data.dat
- @cat text.dat rodata.dat data.dat > $@
- @ rm -f text.dat rodata.dat data.dat
-
-# Assembly listing file (for debugging)
-$(APP_ASM): main.elf
- @$(OBJDUMP) -D -S -z $< > $@
- @if grep -qR "dadd" $@; then echo "NEO430: WARNING! 'DADD' instruction might be used! Make sure it is synthesized!"; fi
-
-# Generate NEO430 executable image for bootloader update
-$(APP_BIN): image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_bin $< $@
-
-# Generate NEO430 executable VHDL boot image
-neo430_application_image.vhd: image.dat $(IMAGE_GEN)
- @$(IMAGE_GEN) -app_img $< $@
- @echo Installing application image to $(NEO430_RTL_PATH)/neo430_application_image.vhd
- @cp neo430_application_image.vhd $(NEO430_RTL_PATH)/.
- @rm -f neo430_application_image.vhd
-
-
-#-------------------------------------------------------------------------------
-# Help
-#-------------------------------------------------------------------------------
-help:
- @echo "NEO430 Application Compilation Script"
- @echo "Make sure to add the absolute path of the msp430-gcc bin folder to your PATH variable."
- @echo "Targets:"
- @echo " help - show this text"
- @echo " compile - compile and generate *.bin executable for upload via bootloader"
- @echo " install - compile, generate and install VHDL boot image"
- @echo " all - compile and generate *.bin executable for upload via bootloader and generate and install VHDL boot image"
- @echo " clean - clean up project"
- @echo " clean_all - clean up project, core libraries and helper tools"
-
-
-#-------------------------------------------------------------------------------
-# Clean up
-#-------------------------------------------------------------------------------
-clean:
- @rm -f *.elf *.o *.dat *.vhd *.s *.bin
-
-clean_all:
- @rm -f $(OBJ) *.elf *.dat *.bin *.vhd *.s $(IMAGE_GEN)
-
-
-#-------------------------------------------------------------------------------
-# eof
Index: trunk/sw/example/timer_simple/main.c
===================================================================
--- trunk/sw/example/timer_simple/main.c (revision 167)
+++ trunk/sw/example/timer_simple/main.c (nonexistent)
@@ -1,92 +0,0 @@
-// #################################################################################################
-// # < simple timer usage example > #
-// # ********************************************************************************************* #
-// # Flashes LED using the timer interrupt. #
-// # ********************************************************************************************* #
-// # This file is part of the NEO430 Processor project: https://github.com/stnolting/neo430 #
-// # Copyright by Stephan Nolting: stnolting@gmail.com #
-// # #
-// # This source file may be used and distributed without restriction provided that this copyright #
-// # statement is not removed from the file and that any derivative work contains the original #
-// # copyright notice and the associated disclaimer. #
-// # #
-// # This source file is free software; you can redistribute it and/or modify it under the terms #
-// # of the GNU Lesser General Public License as published by the Free Software Foundation, #
-// # either version 3 of the License, or (at your option) any later version. #
-// # #
-// # This source is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; #
-// # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. #
-// # See the GNU Lesser General Public License for more details. #
-// # #
-// # You should have received a copy of the GNU Lesser General Public License along with this #
-// # source; if not, download it from https://www.gnu.org/licenses/lgpl-3.0.en.html #
-// # ********************************************************************************************* #
-// # Stephan Nolting, Hannover, Germany 17.11.2018 #
-// #################################################################################################
-
-
-// Libraries
-#include
-#include
-
-// Macros
-#define xstr(a) str(a)
-#define str(a) #a
-
-// Configuration
-#define BAUD_RATE 19200
-#define BLINK_LED 0 // pin 0 on GPIO.out
-#define BLINK_FREQ 4 // in Hz
-
-// Function prototypes
-void __attribute__((__interrupt__)) timer_irq_handler(void);
-
-
-/* ------------------------------------------------------------
- * INFO Main function
- * ------------------------------------------------------------ */
-int main(void) {
-
- // setup UART
- neo430_uart_setup(BAUD_RATE);
-
- // check if TIMER unit was synthesized, exit if no TIMER is available
- if (!(SYS_FEATURES & (1<