--- Log opened Wed Feb 01 00:00:40 2017 | ||
ishan | hlo | 09:23 |
---|---|---|
olofk | How hard is it to do a simple elf reader? Seems hopeless to compile elfutils under windows, which is used for the elf-loader core | 15:49 |
ZipCPU|Laptop | olofk: Easy! | 16:02 |
ZipCPU|Laptop | I think I can even point you at some code for it too ... let me get a link ... | 16:02 |
ZipCPU|Laptop | Look in: https://github.com/ZipCPU/zipcpu/tree/branch8b/sim/cpp for the files zipelf.cpp and zipelf.h | 16:04 |
ZipCPU|Laptop | You'll need to adjust the CPU ID from 0xdad1 to ... whatever the or1k CPU ID is within binutils. | 16:04 |
ZipCPU|Laptop | You can also see how an example of how the loader works in the zsim.cpp file in the same directory. | 16:05 |
ZipCPU|Laptop | Of course ... the demo I just sent you depends upon libelf ... ;) | 16:08 |
Laksen | An ELF reader in HDL? | 16:42 |
olofk | ZipCPU|Laptop: Yeah, that's the problem. The current code works fine on Linux, but it seems like no one has ever managed to compile elfutils (which seem to be the replacement of libelf) for windows | 17:29 |
olofk | Laksen: No. Verilog has a mechanism called VPI, which allows you to define new system calls in verilog that calls out to a shared library for the implementation | 17:30 |
olofk | VHDL has a similiar thing called VHPI | 17:30 |
olofk | And systemverilog has a new mechanism called DPI, but the idea is basically the same | 17:30 |
Laksen | Ah so just for simulation? | 17:31 |
olofk | yep | 17:31 |
olofk | We're using it for several things, but in this case, the verilog testbench gets a string to an elf file, calls $elf_load(filename), and the decoding of the elf file is done by the C library | 17:32 |
olofk | Because no one is insane enough to do these things in verilog :) | 17:32 |
Laksen | Seems too easy though. Why not an actual ELF reader from some ram block initialized with $readmem? :) | 17:35 |
olofk | Laksen: We should start by implementing a filesystem in RTL first to read the file from the ram block :) | 17:38 |
Laksen | Not a bad idea, but it seems unnecessary. For an ELF file it would probably be close to the only file there? | 17:41 |
--- Log closed Thu Feb 02 00:00:41 2017 |
Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!