Debug Boot code
#3
(04-16-2020, 04:07 AM)ninipa Wrote: Hi,

I migrated pulpissimo simulation env to a synthesizable env. I removed tb part so there is no JTAG action (but I confirmed the clocks are all fine in the system). bootsel has been set to 1'b1.
Even without the JTAG action, I expect at least boot-code can run correctly.
But, via compare PC (tb_pulp.i_dut.soc_domain_i.pulp_soc_i.fc_subsystem_i.FC_CORE.lFC_CORE.id_stage_i.pc_id_i[31:0]) value in golden simulation and my simulation. I found that after several instructions, my simulation jumped to another branch, like:
golden sim: .... 0x1a0002dc -> 0x1a0002de -> 0x1a0002e0 -> 0x1a0002e4 -> 0x1a0002e6 -> 0x1a000316 -> .....
my sim:      .... 0x1a0002dc -> 0x1a0002de -> 0x1a0002e0 -> 0x1a0002e4 -> 0x1a0002e6 -> 0x1a0002e8 -> .....
before that, the PC value and sequence is exactly the same

Now my problem of debugging it is: ./sim/boot/boot_code.cde is already made as hex file. I can find the src boot-code at https://github.com/pulp-platform/boot-code, but when I try to make executable, it is invoking "pulp-runtime/install/rules/pulp_properties.mk" but it's not there... (I want to make exe and then objdump it to debug with disassembly)

Can you please point me how to generate the corresponding disassembly to boot_code.cde? Or can you simply help me figure out why my simulation fails with the PC sequence I provided? 

Thank you!

Hi ninipa,

The bootcode is supposed to be built as part of the pulp-sdk. If you already installed and compiled the pulp-sdk you should find the compiled ELF binary and corresponding source code under: pulp-sdk/runtime/boot_code_pulpissimo/build/pulpissimo/boot-pulpissimo/boot-pulpissimo


However, be aware that the boot_code.cde file you found in the pulpissimo repository is quite old and most likely not in sync with the source code and compiled ELF binary in the boot-code repository. If you want to create a new CDE file in order to synthesize a rom you have to do some roundabouts by  first converting the ELF to S19 format: 

riscv32-unknown-elf-objcopy --srec-len 1 --output-target=srec boot_code.elf boot_code.s19

Then you can use the two scripts these two scripts: 
.zip   scripts.zip (Size: 2.69 KB / Downloads: 24)  

and convert it to binary CDE format for ROM generation:

python2 s19toboot.py boot_code.s19 patronus #This generates boot_code.cde in Hexformat and boot_code.sv 
python3 cdeHexToBinary.py boot_code.cde boot_code_binary.cde  #Convert Hex representation to binary representation

Greetings,
Manuel
Reply


Messages In This Thread
Debug Boot code - by ninipa - 04-16-2020, 04:07 AM
RE: Debug Boot code - by ninipa - 04-16-2020, 08:38 AM
RE: Debug Boot code - by meggiman - 04-16-2020, 09:15 AM
RE: Debug Boot code - by ninipa - 04-16-2020, 12:01 PM
RE: Debug Boot code - by meggiman - 04-17-2020, 07:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)