IRC logs for #openrisc Friday, 2017-07-21

--- Log opened Fri Jul 21 00:00:23 2017
mithroDo people have thoughts on ?00:15
mithroHeyo imphil & wallento09:13
imphilmithro, hi09:14
mithroSo at the moment we are getting random lock ups of code running on the or1k and I'm trying to track down what is going on.09:15
mithroimphil: My current theory is some type of memory corruption is going on09:17
mithroWhich is causing the processor to go into the exception state...09:18
mithroI'm about to connect our virtual scope up the the processor, but thought I would see if there was something that the soc debug could give us09:18
imphilprobably a function trace (calls/returns of functions) could reveal a bit. that's working rather well in OSD. What also could help is to put a trace point in the exception handlers of the kernel09:21
imphilbut if you need a quick and dirty solution to get your problem out of the way, chipscope and friends are probably the fastest way to see where the execution stops09:23
mithroI mean gdb debugging would be general good, so if I can kill two birds with one stone09:24
mithrospecially for the linux bring up as it gets further along09:25
mithroimphil: So how would I "integrate" your stuff?09:26
imphilin this case I'd probably go ahead and integrate OSD, even though it doesn't support gdb for now. Working with traces and events isn't nice in some cases, but it should be able to do the job. And as soon as I get around to integrate the gdb stuff, you get that for free.09:27
imphilyou mean how to get osd into litex?09:27
mithroimphil: Yeah09:31
mithroimphil: I assume I need to get some verilog and connect it up to the mor1k core and the uart in some way?09:32
imphilyeah. the most tricky part is usually the off-chip interface. which board are you targeting?09:33
mithroThe Opsis, Atlys and MimasV209:34
imphilThat increases the trickiness a bit possibly, as all others users are currently using Xilinx boards. However, it should be doable with reasonable effort.09:35
mithroimphil: What is the host interface? All the boards have a USB UART that I could connect to the core?09:36
imphilSo. what do we need: (1) a off-chip interface. UART works fine and is implemented in a technology-agnostic way, so it should work well on Altera boards.09:36
imphil(2) some basic debug infrastructure: the debug interconnect (a couple of verilog modules implementing a ring NoC) together with the SCM and HIM modules09:37
imphil(3) the CTM (for trace) and STM (system trace, i.e. printf support) modules connected to the mor1kx core09:37
imphil(4) optional, the UART-DEM module connected to the bus imitating a UART device over the debug interconnect09:37
imphila good reference implementation for what you're trying to do is the compute_tile example in optimsoc running on a Xilinx Nexys 4 ddr board. It's just a single mor1kx core and uses UART as off-chip interface09:39
imphilfind the top-level file here:
mithroSo what is the compute_tile_dm ?09:40
imphilif you look there, the glip_uart_toplevel module is the off-chip interface from UART to a FIFO interface. the debug_interface module ( contains the ring noc and the HIM (host09:42
imphilinterface) and SCM (system control) modules. The ring connections are then passed through the hierarchy and in  the mor1kx core is connected to the CTM (core trace) and STM (system trace) modules09:42
imphilcompute_tile_dm is a full system with just one mor1kx core, a wishbone bus and a memory, i.e. the most simple SoC you could imagine09:43
mithroSo I think I need debug_interface, glip_uart_toplevel, osd_stm_mor1kx, osd_ctm_mor1kx09:46
mithroWhat is osd_mam_wb ?09:46
imphilmemory access. it allows you to read and write a wishbone-attached memory from the host (e.g. to write software into it)09:48
imphila general overview over all these modules is also available at
imphilI don't know how you do that right now, we use the MAM support always to load the software to the device09:49
mithroWe use etherbone like thing09:50
mithroWe also have a BIOS which can load via tftp etc09:50
imphiloh, that's nice :)09:51
mithrolitescope == _florent_'s version of chipscope09:51
imphilso to get started, I'd start getting the off-chip interface up and running. for uart, it should be easy, but still constraint files are easy to mess up. Since OSD uses GLIP to encapsulate the off-chip interface, I'd recommend first getting a loopback example through UART running.09:53
imphilGet the GLIP source code, and start with this example: and modify it to work for your board. It shouldn't be more than the constraint files and clocking.09:54
imphilif that works, you can add the debug_interface and the glip_toplevel_uart to your project and with only that you should already be able to connect to your board through the opensocdebug software.09:55
imphilif that's running everything else becomes much easier, since you now can add the other debug modules one by one and confirm they're working09:56
mithroI already know all the pins for the uarts and stuff, we use them all the time10:01
mithroI think that gives me enough to go on10:03
imphilgive it a try, and let me know if you have any problems. It's sometimes just small tiny things which prevent the system from working, and I think I've seen most of them by now :-)10:04
mithroWill hopefully get to it this weekend10:05
imphiland if you have a choice of USB UART, use the fastest one you can find. Especially for tracing bandwidth is king.10:05
mithroNone of our uarts are particularly fast - we normally just use the GigE10:07
--- Log closed Sat Jul 22 00:00:25 2017

Generated by 2.15.2 by Marius Gedminas - find it at!