cinera_handmade.network/miotatsu/riscy/riscy/riscy021.hmml

76 lines
4.6 KiB
Plaintext

[video member=miotatsu stream_platform=twitch project=riscy title="Exploring the Config String Memory with the HiFive1" vod_platform=youtube id=gXDQbKreTG0 annotator=Miblo]
[0:07][Recap and set the stage for the day]
[0:27][Show some off-stream work, compiling the Freedom E SDK]
[1:20][@serge_rgb][Sorry, I can't stay to watch the stream... gotta go to bed]
[1:37][Determine to add the HiFive1 Getting Started Guide[ref
site=SiFive
page="HiFive1 Getting Started Guide"
url=https://static.dev.sifive.com/pdfjs/web/viewer.html?file=https://static.dev.sifive.com/dev-kits/hifive1/hifive1-getting-started-v1.0.2.pdf] to the forum post]
[2:37][Upload our program to the HiFive1]
[4:25][Note that we'll be printing garbage to the terminal]
[5:16][Reset the board to :run our program, with unexpected output]
[6:11][Consult the annotations[ref
site=YouTube
page="RISCY BUSINESS - Day 021: Exploring the Config String Memory with the HiFive1"
url=https://www.youtube.com/watch?v=XOis4wG2gYU] for how to kill screen]
[9:34][Kill screen and :run make again]
[10:21][Cast config_string to an int and make and upload it again]
[11:23][Investigate errors]
[12:18][@hossein1387][It usually goes away after a reset]
[12:24][Reset and try uploading again]
[13:05][:Run our program and view the output]
[14:43][Change print_instructions() to compute the len differently]
[15:27][@hossein1387][Yeah, I change it to: size_t len = 0x00001010 - sizeof(config_string);]
[16:30][Consult the documentation for the configuration string length[ref
site="SiFive Developers"
page="E3 Coreplex Manual"
url=https://static.dev.sifive.com/pdfjs/web/viewer.html?file=https://static.dev.sifive.com/SiFive-E3-Coreplex-v1.2.pdf]]
[17:42][Remake, upload and :run our program]
[19:35][Try what @hossein1387 suggested]
[20:23][:Run and admire our output]
[22:17][Consult the documentation on cs-v1[ref
site="RISC-V"
page="Draft Privileged ISA Specification v1.9.1"
url=https://riscv.org/specifications/privileged-isa/]]
[25:01][@hossein1387][Take a look at Privileged doc: Chapter 8]
[25:57][Read about the Machine Configuration Strings[ref
site="RISC-V"
page="Draft Privileged ISA Specification v1.9"
url=https://people.eecs.berkeley.edu/~krste/papers/riscv-privileged-v1.9.pdf]][:research]
[32:49][Determine to update print_instructions()]
[34:20][@hossein1387][Yeah, I also tried it with strlen. It gave me the same result]
[35:14][:Research strlen() vs sizeof() for a char *]
[38:09][Update print_instructions() to search for the config_string and then output its length]
[39:59][Make and upload our program]
[41:30][:Run our program and determine to ask on the forums why we get so much error and info output]
[44:52][Unplug, replug and upload again]
[45:23][:Run our program, see no output and investigate why]
[47:51][Consult the [ref
site="RISC-V"
page="Draft Privileged ISA Specification v1.9"
url=https://people.eecs.berkeley.edu/~krste/papers/riscv-privileged-v1.9.pdf]]
[49:09][Remove the loop from print_instructions(), and :run again]
[50:42][Investigate the values known by print_instructions()]
[52:56][:Run our program and see now output from that either]
[53:26][Test printf()]
[54:46][Determine that printf() is not implemented]
[55:16][@hossein1387][I have worked with the risc-v64 GCC and I used printf. Works there, but here it's not working]
[56:00][@hossein1387][Oh by the way, I programmed my FPGA with a RISC-V core and wrote a simple program to get the config string at the same memory location as HiFive1 (0x0000100c), but it gave me processor halt. So I think the address is platform dependent]
[57:19][Take a look at other demos, and wonder why we can't use printf() in demo_gpio.c]
[58:42][Try the hello demo]
[1:00:13][:Run the hello demo and also see no output]
[1:00:39][We are out of time for today, with very many questions]
[1:01:13][@hossein1387][One more thing I tried: char* config_string = 0x0000100c + 0x20004; which crashed the program. I also tried: char* config_string = 0x20004; which printed out garbage]
[1:01:35][Consult the documentation for #include[ref
site="RISC-V"
page="Draft Privileged ISA Specification v1.9"
url=https://people.eecs.berkeley.edu/~krste/papers/riscv-privileged-v1.9.pdf] and configuration string[ref
site="SiFive Developers"
page="E3 Coreplex Manual"
url=https://static.dev.sifive.com/pdfjs/web/viewer.html?file=https://static.dev.sifive.com/SiFive-E3-Coreplex-v1.2.pdf][ref
site="SiFive Developers"
page="Freedom E310-G000 Manual"
url=https://www.sifive.com/documentation/chips/freedom-e310-g000-manual/]]
[1:06:07][Stay RISCY, everyone]
[/video]