Comments (3)
Thank you for the suggestions!
Well, the information at boot is the start address of each segment, but it appears that there is a mistake here and the data segment is in the wrongly location... it says:
boot0: text@0 data@6900 stack@8192 (1292 bytes free)
Which means that the text segment starts at position 0, the data starts at position 6900 (which is wrong) and the stack starts at position 8192. The free memory is calculated by the stack-heap, which is correct: the stack can down to the heap. Of course, when the stack reaches the heap, the code will probably crash, but it depends of the core that is running. By coincidence, the last variable in the code is the headcheck variable, which is checked all time. Case this variable changes, the code will print an out of memory diagnostic.
Well, I made some changes today and it is now far better:
boot0: text@0+5360 data@5360+1600 stack@8192 (1232 bytes free)
Which means that the text segment starts at position 0 and have 5360 bytes, the data segment starts at 5360 and have 1600 bytes, and the stack segment starts at position 8192 down to the end of data segment, in a way that we have 1232 bytes. Checking the sum of 5360+1600+1240 is exactly 8192!
The same code, but with the HARVARD option in the build will result in:
boot0: text@0+5360 data@8192+1600 stack@16384 (6592 bytes free)
Which means that the text segment starts at position 0 and have 5360 bytes; the data segment starts at 8192 and have 1600 bytes and the stack starts at 16384, all correct, since now we are working with 8KB of ROM and 8KB of RAM. Also, the available memory for stack is 6592 bytes, in a way that 1600+6592 is 8192. Of course, there are some free memory in the ROM memory, but it cannot be used by the stack, as long it is in the instruction bus and the stack requires that the memory is in the data bus.
Interesting is that the text and data sizes are the same, which makes sense, since they are only in different positions.
from darkriscv.
oh, I forgot the 4 bytes from .sdata... but it is already fixed:
.bss 0x0000000000001b30 0x0 boot.o
*(.sdata)
.sdata 0x0000000000001b30 0x4 main.o
0x0000000000001b30 heapcheck
0x0000000000001b34 _edata = .
0x0000000000002000 PROVIDE (_stack = (ORIGIN (MEM) + LENGTH (MEM)))
boot0: text@0+5360 data@5360+1604 stack@8192 (1228 bytes free)
from darkriscv.
Great! darkriscv will be more and more perfect!
from darkriscv.
Related Issues (20)
- mixed little/big-endian HOT 1
- Development tool install error HOT 2
- issue type of data in the struct DARKIO HOT 1
- "srai" instruction doesn't work on ISE/Spartan 6 HOT 4
- Compiling error HOT 8
- Expanding the DarkRISCV Family!
- Works on DE0 Nano Altera Cyclone IV HOT 18
- Is this board named khc40gbe_k420? HOT 9
- Verilator Support
- Problem with sample firmware HOT 7
- WIll you be willing to add dcumentation on memories ? HOT 2
- disable default nettype HOT 1
- replace all defines by parameters HOT 1
- bus bridge to AXI
- Why set two general-purpose register groups HOT 18
- Running CoreMark benchmark in DarkRISCV! HOT 13
- START HERE!
- New board: Alinx AX309 HOT 1
- Expected data bus latency? 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 darkriscv.