IRC logs for #openrisc Wednesday, 2017-02-01

--- Log opened Wed Feb 01 00:00:40 2017
ishanhlo09:23
olofkHow hard is it to do a simple elf reader? Seems hopeless to compile elfutils under windows, which is used for the elf-loader core15:49
ZipCPU|Laptopolofk: Easy!16:02
ZipCPU|LaptopI think I can even point you at some code for it too ... let me get a link ...16:02
ZipCPU|LaptopLook in: https://github.com/ZipCPU/zipcpu/tree/branch8b/sim/cpp for the files zipelf.cpp and zipelf.h16:04
ZipCPU|LaptopYou'll need to adjust the CPU ID from 0xdad1 to ... whatever the or1k CPU ID is within binutils.16:04
ZipCPU|LaptopYou can also see how an example of how the loader works in the zsim.cpp file in the same directory.16:05
ZipCPU|LaptopOf course ... the demo I just sent you depends upon libelf ... ;)16:08
LaksenAn ELF reader in HDL?16:42
olofkZipCPU|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 windows17:29
olofkLaksen: 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 implementation17:30
olofkVHDL has a similiar thing called VHPI17:30
olofkAnd systemverilog has a new mechanism called DPI, but the idea is basically the same17:30
LaksenAh so just for simulation?17:31
olofkyep17:31
olofkWe'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 library17:32
olofkBecause no one is insane enough to do these things in verilog :)17:32
LaksenSeems too easy though. Why not an actual ELF reader from some ram block initialized with $readmem? :)17:35
olofkLaksen: We should start by implementing a filesystem in RTL first to read the file from the ram block :)17:38
LaksenNot 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!