Comments (3)
- Download the latest GCC from https://github.com/gnu-mcu-eclipse/riscv-none-gcc/releases/ (thanks to Liviu Ionescu [email protected]).
- Build elf2raw64 tool and copy it into gcc/bin folder (setup PATH variable).
- Edit examples/boot/src/main.c file by adding your functionality into method _init() before copy_image() call.
- Modify method led_set(int) accordingly with your requirements.
- Run make (or make.bat) from examples/boot/makefiles.
You should get the new HEX-file with your modifications directly used by rtl.
You can do the same things with other examples.
Image is copying under conditions in bootloader:
if (tech != TECH_INFERRED && pnp->fwid == 0) {
memcpy(sram, fwrom, FW_IMAGE_SIZE_BYTES);
}
It means: not behaviour simulation AND run the first time after power-on. So I suppose you are running NOT behaviour simulation.
from riscv_vhdl.
Hi Sergey,
Looks like we can modify
fw/boot/src/main.c
to add the peripheral code before "copy_image()".
If we were to comment out the "copy_image()" would RISCV read and execute
from ROMIMAGE instead of SRAM ?
void _init() {
uint32_t tech;
pnp_map *pnp = (pnp_map *)ADDR_NASTI_SLAVE_PNP;
uart_map *uart = (uart_map *)ADDR_NASTI_SLAVE_UART1;
// Half period of the uart = Fbus / 115200 / 2 = 70 MHz / 115200 / 2:
//uart->scaler = 304; // 70 MHz
uart->scaler = 260; // 60 MHz
led_set(0x01);
print_uart("Boot . . .", 10);
led_set(0x02);
///////////////////////////// PUT NEW PERIPHERAL CODE HERE ////////////////
copy_image(); /////////// WHAT HAPPENS IF WE COMMENT THIS OUT ???? //////
led_set(0x03);
print_uart("OK\r\n", 4);
led_set(0x04);
}
from riscv_vhdl.
You can remove copy_image() method if your target (configuration parameter) CFG_MEMTECH = inferred OR /rtl/techmap/gencomp/gencomp.vhd is_fpga() returns 1.
In this case SRAM module (512 KB) instantiates tech. modules sram8_inferred_init that will be initialized by FwImage after power-on.
Otherwise you will have unpredicatable behaviour after jump to SRAM base address. I forget is there compressed instruction corresponding to zero value 0x0000 that CPU will try to execute or it will raise an exception "unknown instruction".
from riscv_vhdl.
Related Issues (20)
- What configuration did you use for Rocket core? HOT 2
- Cannot find _run_functional_sim.sh HOT 2
- showing CPU is turned off HOT 1
- Openning ttyUSB0 at 115200 . . .failed" HOT 3
- Generating bit file for boot up using debugger HOT 5
- Uart Conf HOT 1
- Error compiling debugger HOT 1
- gptimer alignment in the second timer is not correct HOT 2
- Communicating with the ML605 Board (v8.0) HOT 4
- can you run linux? HOT 2
- problem compilation with options: -march=rv64imafd -DFPU_ENABLED HOT 1
- GNSS module HOT 1
- Build debugger with GUI failed: libdbg64g.so undefined reference HOT 1
- How to generate VCD files of bare-metal dhrystone with _run_systemc_sim.sh? HOT 4
- slurm dependency HOT 3
- Run Hello world example on VC707 board HOT 24
- riscv_soc_tb Simulaton HOT 18
- Adding a Master peripheral HOT 27
- simulation of kc705_tb HOT 19
- Any plans or suggestions for laticce or gowin fpga chips support? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riscv_vhdl.