IRC logs for #openrisc Monday, 2015-11-02

--- Log opened Mon Nov 02 00:00:52 2015
andrzejrI had a look at entry.S and traps.c and it looks like linux "handles" misaligned memory accesses by SIGSEGV or OOPS - I was expecting a workaround issuing two aligned reads and optionally two aligned writes.02:04
andrzejrnot sure why pinging another host produces such unaligned access - It may likely be triggered by an error in my code but the kernel should be able to handle it more gracefully. Kernel from
andrzejran alternative (and rather elaborate) implementation of the exception handler is commented out. Why?02:09
wbxolofk: the strange thing is, i get the same issues in or1k-sim and qemu. need to write a mail about it. may be my kernel config is plain wrong05:24
stekernandrzejr: if you got unaligned accesses, you've hit a bug06:50
stekernwbx: what is the issue you are seeing?06:52
jeremybennettGeneralStupid: Is this what you were after:
andrzejrstekern, "c00335dc:       84 65 00 c0     l.lwz r3,192(r5)" in account_system_time accessed 0x3efff8be when pinging remote host08:28
stekernso, r5 is 0x3efff8be-19208:31
stekernis it suppose to be?08:31
GeneralStupidjeremybennett: no, it was just the result of a discussion... Somebody told me that openrisc is not energy efficient...09:54
GeneralStupidjeremybennett: i think the use of a fpga is already waste of energy...09:55
GeneralStupidbecause an absolute equal asic will have better energy efficient09:55
olofkGeneralStupid: There are hardly any power management features in the openrisc spec, but you can do a lot by clock gating the peripheral cores10:01
GeneralStupidolofk: but thats commercial use... What i heard they better pay for tensilica and thats it :)10:03
GeneralStupidbad english: what i meant is10:03
GeneralStupidThey like to pay for tensilica then using an open cofre10:03
stekernolofk: are you behind this?
olofkstekern: Haha :) I read about that. I LOVE the internet10:16
GeneralStupiddo you know these "twich installs archlinux" stuff?10:16
GeneralStupidolofk: i start to hate the internet ... every day a little more :)10:21
stekernfor me it's mostly a love-hate relationship...10:22
GeneralStupidi agree with stekern :)10:22
GeneralStupidits ok to use it for entertainment. But some things are really ... Hm10:23
GeneralStupidWe are able to communicate by voice and picture around the world... And we are able to send informations within a few ms... Technically Internet is an amazing thing...10:24
GeneralStupidand we start to using it installing a linux distribution over twitch comments...10:24
jeremybennettGeneralStupid: You are correct about FPGAs and energy, although it has got a lot better in the last decade. But if your project will sustain an ASIC, it will be much lower power.13:03
jeremybennettThere was an interesting talk on this at ORCONF from the team making a multicore OpenRISC/RISC-V lower power design (ST, Bolona University and I think ETH Zurich)13:04
andrzejr_stekern, I'll check that at home. This function is in kernel scheduler, so if even that cannot guarantee aligned accesses we should have a safer fallback. At least in the default configuration.13:32
stekernandrzejr_: on what are you seeing this?13:55
stekernI highly doubt that that function would do unaligned accesses13:56
stekernI have never seen an unaligned access in the kernel that wasn't caused by an (external) bug13:57
andrzejr_well, my ETH Mac13:57
andrzejr_may have hw bugs13:58
stekernhave you tried to reproduce on or1ksim?13:59
andrzejr_the error occurs immediately after I start ping13:59
stekernsomething being overwritten by the DMA?13:59
andrzejr_no, I've never used that before13:59
andrzejr_can I disable DMA for test?14:00
andrzejr_BTW, which kernel version do you use?14:01
andrzejr_same here14:02
stekernif you are using the standard ethmac, I don't think you can use it without dma14:03
-!- Netsplit *.net <-> *.split quits: Pimster, robtaylor, aburgess, Shentino, GeneralStupid, mboehnert, wallento, jn__15:35
-!- mboehnert1 is now known as mboehnert15:35
-!- Netsplit over, joins: wallento15:36
heshamolofk: The riscv core is now working along with the UART, GPIO, ROM cores, on Icarus,16:23
heshamAnd Atlys16:23
heshamI am afraid to begin with ddr2 actually :/16:23
ysionneauif you are searching for some ddr2 controller for spartan6 maybe ask _florent_ if he had misoc running (with DDR) on the Atlys board16:43
ysionneauanyway you have litedram which seems to work for S6+DDR2
homeless_olofk: I sent an e-mail to the group about atlys board. Please take a look... Have a good day.16:55
_florent_ysionneau: litedram is a work in progress not yet validated (I wanted to test an architecture that is bit different than MiSoC's SDRAM controller)16:59
_florent_I'm still using MiSoC's SDRAM controller16:59
heshamysionneau: There's already one for Atlys, but I suspect it will need some more effort to get it working with this new experimental riscv core. And ddr2/memory cores is always a problem16:59
heshamI'll have to give it a try17:00
_florent_the implementation we have that is running on the Atlys and the Numato Opsis is mithro's HDMI2USB17:01
ysionneau_florent_: oh ok :)17:02
ysionneaugood news!17:02
ysionneauah, I was looking in your own repos for atlys, it's in mithro's one, ok17:02
ysionneauah no it's just the halfrateddrphy17:03
_florent_but that's maybe not the proper solution for hesham (require to have a part of the design using Migen)17:04
_florent_doing good simulations with the micron model can probably help for that17:04
ysionneauyep or generate the verilog code and use that17:05
ysionneaua bit unclean but could at least help for a starter17:05
heshamThe Atlys orpsoc is already using the generated MIG/micron core I think.17:06
_florent_OK, that's probably better to stay with that17:07
salman_heelo? If I uncomment //`define OR1200_FPU_IMPLEMENTED in the de0_nano FuseSOC model, will that implement a hw fpu?17:08
salman_rather from this file : systems/de0_nano/rtl/verilog/include/or1200_defines.v:424://`define OR1200_FPU_IMPLEMENTED17:08
heshamGood news, a simple store/load from riscv/bootrom to ddr2 on Atlys seems to work fine.17:53
olofksalman_: We generally recommend using mor1kx rather than or1200 nowadays. It has a better FPU than or1200 too18:04
olofkhesham: Great to hear18:05
olofkwow.. it's been a while since anyone regenerated the intercon files for atlys18:18
GeneralS1upidolofk: i think they should be generated at build... ?!18:26
-!- GeneralS1upid is now known as GeneralStupid18:26
salman__is the mor1kx fpu enabled by default?18:35
GeneralStupidsalman__: look at your mor1kx.v file18:38
GeneralStupidsalman__: FEATURE_FPU - in my de2 port its disabled18:39
salman__I think its mor1kx_cfgrs.v and its set to NONE..I will change it to ENABLED.18:43
salman__On the DE0_Nano, that is..18:43
GeneralStupidsalman__: but change it in the openrisc toplevel file...18:44
salman__not in the /build/de0_nano/src/mor1kx-3.1/rtl/verilog?18:45
GeneralStupidsalman__: no, i would never change the default values in the module itself18:46
salman__This the build directory...I don't see it anywhere in the top level of the build except in the modules...even the in the bld_quartus has it as NONE.18:48
salman__So you are saying I need to change it in the orpsoc_cores/system/de0_nano?18:49
salman__I did this and it didn't turn up : ssheikh@gs66-msaglnx1:~/orpsoc-cores$ !gre grep "FEATURE_FPU" -irn *18:49
salman__Should It be in orpsoc-defines.v? So a `define FEATURE_FPU on a line?18:52
GeneralStupidsalman__: no, you should have an orpsoc_top.v18:56
GeneralStupidsalman__: ~/projects/fusesoc/build/de2/src/de2/rtl/verilog/orpsoc_top.v tahts my path18:56
GeneralStupidthere is a mor1kx instance where you should add the FEATURE_FPU line, that would overwrite the defaults18:57
salman__okay, I will try that...18:57
salman__this is done after I run fusesoc right? So, I am adding it after I've generated all the build src files?19:01
GeneralStupidyou could use the quartus project and then rebuild with the quartus GUI19:02
olofksalman_: mor1kx uses parameters instead of defines for most of its configuration19:23
salman_I tried a FEATURE_FPU in the orpsoc_top.v under mor1kx but quartus says it can't find it..then I realized that its not brought up to that level.19:34
olofksalman_: Are you using de0 nano?19:35
salman_whereas FEATURE_DMMU which is at that level is defined in many other lower level files.19:35
olofkaha. I think I know now19:36
olofkde0 nano is set to use mor1kx-3.1 by default. The FPU was added after that19:37
olofkIn orpsoc-cores/systems/de0_nano/de0_nano.core, change mor1kx-3.1 to mor1kx and try again19:38
olofkIn the list of dependencies there19:38
olofkstekern: Want to smack on a tag on mor1kx and call it 4.0 or something?19:39
olofkor 3.2, or PI19:39
olofkI feel sometimes like the release managment of mor1kx is driven by me whining about wanting a new version :)19:40
olofkHopefully not PI19:47
stekernoh, really, I haven't made a release with the FPU?20:16
stekernthat's an oversight20:16
stekernI'm busy and tired tonight, so it'll have to wait until tomorrow.20:17
stekernbug me again if you haven't seen one by 11 pm tomorrow night ;)20:17
salman_it to try it there a way to turn it on/compare performance w/wo it...use a or1k-elf-gcc switch20:33
olofksalman_: Great. bandvig (who isn't here right now) made the FPU implementation for mor1kx, so he's probably the guy to ask for performance stuff20:35
olofkI'm actually not even sure how to enable the FPU in gcc20:35
GeneralStupid-mfloat-abi (i own an old beagleboard with ARM and FP unit ;))20:36
salman_or1k-elf-gcc -mfloat-abi=hard sincos.c -mboard=de0_nano -o sinhard.exe or1k-elf-gcc: error: unrecognized command line option ‘-mfloat-abi=hard’20:42
GeneralStupidsalman__: looks like it just works for arm :/20:43
GeneralStupidsalman__: try -mhard-float20:44
salman_yeah that compiles..20:45
olofkI tried -mhard-float. It compiles, but I don't see any fp instructions when doing an objdump20:47
olofkOh well. There are most likely other people in here who knows what to do20:48
GeneralStupidsalman__: do you want to use linux on your soc?20:50
salman_not really (for my personal interest yeah) but we are specing using this in an Actel for a cubesat...20:51
salman_first getting the toolchain and fusesoc understood with the de0_nano for starters..20:51
salman_we are thinking a ProASIC 3 eventually20:51
salman_FPU would be good so we can do some onboard number crunching...20:52
daliasdoes the or1k l.j instruction really take an absolute address and not a relative one??20:52
GeneralStupidfixedpoint ;)20:52
daliasthe doc i'm looking at claims so20:52
daliasbut that makes no sense because the address field is only 26 bits20:53
daliaslooks like nonsense to me20:53
dalias   4:   10 00 00 00 4 <__sigsetjmp+0x4>20:54
dalias                        4: R_OR1K_INSN_REL_26   ___setjmp20:54
daliasoh that's bf20:54
daliasthis is what i meant to look at:20:54
dalias  24:   00 00 00 00     l.j 24 <__sigsetjmp+0x24>20:54
dalias                        24: R_OR1K_INSN_REL_26  __sigsetjmp_tail20:54
olofksalman_: There was an OpenRISC running on a ProASIC3 in a Cubesat about four years ago actually20:54
daliasstill looks relative to me20:54
olofkNASA TechEdSat I think20:54
daliasguess this is all wrong:
olofkWhat the hell is or1300?20:56
olofkdalias: l.j is relative20:56
daliasno idea20:56
daliasthanks for confirming :)20:56
olofkOr my bootloader contains a bug :)
daliasand am i remembering right that or1k always has a delay slot?20:59
olofkA bit scary that the cgen info is wrong. Is that autogenerated from binutils?20:59
daliasno idea where it comes from20:59
olofkdalias: Yes. Although since ~2012 there is also a nd (no delay-slot) version as well, but that isn't well supported21:00
daliasit looks like cgen is unrelated to binutils21:00
daliasi'm just trying to confirm that this patch to musl is going to be ok:
daliasadding a __cp_cancel label to all archs' cancellable syscall code21:01
olofkI have absolutely no idea :)21:01
daliasbecause providing a default def of the label as a C function had problems on some archs21:01
daliaswell it looks ok to me21:02
olofkIs it possible to make a testcase for it?21:02
daliasit will get caught in regression testing before next release if it breaks anything21:02
olofkThat answered my question :)21:02
daliasfighting awful gcc bugs:
daliasor binutils bugs as it likely is, but they want to fight over whose fault it is :-p21:04
olofkI'm sure it's Microsoft who planted a bug to undermine the credibility of open source software21:09
daliasit seems to be Alan Modra's fault:;a=blame;f=gas/symbols.c;hb=f0abc2a11f47c3ecdfe0b54421092d17c70fc5f2#l181721:11
daliaserm wrong link21:12
daliasi don't understand how gitweb's git blame links work21:12
andrzejrdalias, openrisc_arch.pdf says: PC < - exts(Immediate < < 2) + JumpInsnAddr21:13
dalias"< <"21:13
dalias< 3 pfd21:13
olofkdalias: Yeah, we should really convert that spec to markdown or asciidoc or docbook or whatever is most appropriate21:19
olofkSomeone did that for the or1200 spec IIRC a while ago21:19
salman_is there  a way to run an executable with an input argument via openocd or telnet session?21:27
olofksalman_: Don't think so21:32
olofkYou need to compile that into your program21:32
olofkUnless you run it under linux of course21:32
olofkHmm.. who was it that was working on a netBSD port for OpenRISC a while ago21:35
olofkAnyone around with an Atlys board?22:05
olofkI've moved the bootloader base address and increased the address space, but I don't have any hw to test it with22:05
heshamolofk: Do you have a .bit file? I've the board right now.23:37
--- Log closed Tue Nov 03 00:00:53 2015

Generated by 2.15.2 by Marius Gedminas - find it at!