IRC logs for #openrisc Tuesday, 2014-05-13

--- Log opened Tue May 13 00:00:46 2014
blueCmdstekern: I might actually make it with 2 define_insn instead of my previous nightmare scenario of 8! I'm happy :-) Now I just need to find myself a slot of 2-3 hours to code the rest and we should have atomic builtins07:13
stekernblueCmd: \o/07:13
stekernI've got Linux compiled with CONFIG_SMP enabled yesterday too07:14
stekern...but with an immense amount of stubs ;)07:14
stekernturns out, 96% of what's needed for SMP is to add support for atomics07:15
stekern(and those can of course be used/useful in the non-smp case as well)07:16
blueCmdstekern: gj!07:23
blueCmdlooking forward to my daily commit07:23
stekernI think it'll be an evening snack today ;)07:25
stekernand probably a cmpxchg instead of the spinlocks07:25
LoneTech_franck__: iirc, yes, you can have odd lengths and unaligned addresses on BDs, but there's an off by one in words accessed, and no real handling of errors07:34
olofk_franck_: Sorry. I haven't had time to look at the ethmac in more detail07:57
_franck__LoneTech: olofk : the problem is coming from my DRAM controller....07:57
olofk_franck_: Have you run tests on it with the wb_bfm_transactor?07:58
_franck__I have. AFAIR it doesn't do much non burst transaction, right ?08:00
_franck__I have an extra ack going out of my controller. I mess things up because Txlength is decrease one more time08:01
olofk_franck_: No non bursts actually :(08:02
olofkI'll put it on the TODO list08:02
_franck__I should put something in my tb to check if ack = 1 && cyc = 0 and then generate an error08:09
olofkThe ack should be ignored if cyc = 0, so if the master sees the ack, I would that it's doing wrong08:17
olofkwould say08:18
_franck__looks like ethoc does not ignore it08:19
olofkYou should send a bug report to the maintainer :)08:19
_franck__is there any picpaste website where one could paste a picture diectly in the web browser ? now I need to paste my screenshot in a "MS paint like" program then save it then upload it to picpaste08:22
stekernshout if you find one08:31
_franck__stekern: ?08:34
_franck__ ?08:34
stekernworks like a charm08:40
_franck__I should have search for this before :(08:41
stekernblueCmd: you get a little appetizer for lunch:
stekernI'm *very* disappointed that you didn't catch that bug when I showed you the original patch :(09:20
rahanybody seen these boards?09:23
rahthey're linked from here:
rah"For our products we provide a powerful Open Source SDK"09:25
raholofk: they might be interested in putting together a board that meets the requirements we spoke about the other day09:26
raholofk: perhaps it would be worth firing off an email09:27
LoneTechwhy doesn't l.jalr take a destination register anyway?09:44
stekerninstead of r9?09:46
stekernI don't know, in theory it would perfectly well be able to. Would there be any huge benefit of that though?09:48
LoneTechit's a hardcoded special case mux in or1200_ctrl making the instruction set less orthogonal, and it doesn't save any bits for the j*r instructions09:48
LoneTechI wouldn't call it huge, but it could be useful in special cases like mutually tail recursive functions or the dynamic symbol resolver09:49
LoneTechit's one of the two special cases where the ABI is present in the logic (the other is r0=0, but wasn't always so)09:50
stekernwhere is r0=0 present in the logic?09:50
stekernbut anyway, I agree. l.jalr could have been designed to take a dest reg, then l.jalr rX, r9 would just be aliased to l.jalr rX in the assembler09:51
stekernwell, aliased the other way around I mean09:52
stekernthere's a similar architecture quirk in the eco32 instruction set btw ;)09:52
stekernwhere the return from exception instruction use a predefined GPR as the target09:53
LoneTechI remember seeing r0=0 in logic, but it was a change and I'm not sure where09:56
stekernI think it was a patch that never got applied/accepted10:00
LoneTechthere's a lot in the instruction encoding that's confusing though. like why l.movhi and l.macrc are distinguished by a bit in the A field, even though they are totally unrelated and there are opcodes free10:19
LoneTechI think that misses one of the points of a risc, to encode the instructions consistently and thereby reduce decoding logic10:20
stekernyeah, that annoys me a lot too :(10:21
LoneTechsimilarly l.j^l.jal != l.jr^l.jalr10:22
LoneTechso instructions that are related aren't all grouped for logic either10:23
LoneTechload instructions sign- or zero-extend also don't match up nicely10:24
LoneTechit's not very costly, but it is inelegant10:24
rahhow does the spec get changed?10:35
stekernrah: how do you mean?10:36
rahstekern: is there a defined process for revising the OpenRISC 1000 architecture specifiction?10:37
stekernwe discuss the possible changes and when we agree upon something (or when at least the majority agree on something) we add it to the spec.10:37
stekernthere's a wiki page where we gather suggestions10:38
rah  ?10:38
stekernand a lot of spec discussion are done on the mailing lists and also on the orconf conferences10:38
sb0is the binutils/gcc architecture name or1k or or32?10:41
stekernbut it has been or32 in the past10:42
sb0hmm, binutils 2.24 still has or3210:42
sb0guess I should use the github toolchain and not ftp.gnu.org10:43
stekernbinutils is upstreamed (as or1k), but there has not been a binutils released since it was upstreamed10:43
sb0ok, I'll do a svn co from gnu then10:44
sb0is gcc 4.9.0 fine?10:44
stekerngcc otoh is another story, that's not upstreamed10:44
rahstekern: I see, thanks10:45
stekernprobably using everything from the github repos is still easiest10:45
stekernsb0: these instructions should still be valid:
LoneTechaha! found the old script that generated the machine code reference table. that could be handy if we do fix encodings10:48
LoneTechless so if we move to a saner source format, of course10:49
sb0are there any expected problems if I use the GNU repository for binutils instead?10:51
sb0your github has 1) problems with new versions of texinfo 2) ../sysdep.h:30:20: fatal error: bfdver.h: No such file or directory10:52
stekernno, not any expected problems, I built from upstream about a week ago10:53
stekernbut 1), did they break the texinfo stuff again??10:54
stekern2) never seen that10:54
stekern...but if that's so, even more a reason for use to hurry up in deprecating or1k-src and breaking out newlib from that...11:01
sb0hmm, both problems also happen with gnu upstream11:02
sb0just with: ../configure --target=or1k-elf && make11:02
sb0in binutils11:03
LoneTechI don't seem to have any bfdver.h - and git is told to ignore it. it must be autogenerated11:03
LoneTechbfd/ChangeLog-0203:     (AC_OUTPUT): Make bfdver.h from version.h.11:03
LoneTechseems to have gone back and forth on whether to have it11:04
stekernI've got this in my config.log: ../binutils-gdb/configure --target=or1k-elf --prefix=/opt/or1k --disable-nls --disable-gdb11:04
LoneTechsb0: just ran your command; make created bfdver.h in bfd11:06
sb0oh, seems I have to run it from the top-level directory11:07
sb0and not just in binutils (even though it's the only thing I want)11:07
sb0compilation is running atm11:07
LoneTechI ran in binutils-gdb/build11:07
sb0I was running it in binutils-gdb/binutils/build11:08
LoneTechaha. well, binutils depends on bfd; that might work if you've built and installed bfd, but I'm not so sure11:08
LoneTechI'd class it as an oversight in binutils configure script11:08
amsit isn't.11:17
amsthe top level is binutils-gdb; not "binutils-gdb/binutils"11:17
amsbinutils, gdb, etc, link to ../bfd/libbfd.a ... which is needed to build ... it is like ls links to ../lib/libgnu.a in coreutils; and you can't build "ls" directly under src/ unless you have built top-level (or parts of top-level)11:18
LoneTechlooks like gpl3, even12:38
olofkLoneTech, sb0: I talked to jeremypbennett a few years ago and he agreed that we could treat that file as public domain12:41
jeremypbennettLoneTech: sb0: It is part of my old newlib port, which being designed for teaching purposes was GPLv3. However in the case of setjmp.S, the code is so generic (look at all the other ports), it would be hard to argue that there is meaningful IP in there of mine.12:47
sb0jeremypbennett, ok. can I remove this header and replace it with "public domain code written by Jeremy Bennett"?12:48
jeremypbennettNo. I'm just saying that if you use it, you would not be in breach of the GPL. This means you should remove the header and replace with whatever you want  for your project.12:50
jeremypbennettBTW - public domain is a very bad idea. Not all jurisdictions support the concept - someone has to own the rights. You are much better explicitly giving a license to you code to make those rights freely available.12:51
jeremypbennettIf you don't care what people do with your work, give it an MIT license or similar12:52
sb0yeah, I normally use BSD12:52
sb0OK to use a BSD header?12:52
sb0I guess so, as you said "replace with whatever you want" :)12:52
amsthe bsd license is not a free software license.12:52
sb0ams, huh, why so?12:53
amsit has the advertising clause12:53
jeremypbennettIt's yours. The point I am making is that I do not believe that particular fragment of code contains any intellectual property of mine, so you can do what you want with it.12:53
sb0ams, like nitpicking, heh :) I'm using the short version without the advertising clause12:53
amssb0: well, it is license, kinda the whole point :/12:53
jeremypbennettdown to the subtle difference between "open source" and "free". That's why I almost always use GPL for code.12:53
amsjeremypbennett: if you wanna know12:54
amsjeremypbennett: there are for example license that are "open source" but not free software licenbses.12:54
LoneTechwe used to have a legal creator's rights here.. I wonder if they've mangled that totally with copyright treaties12:56
LoneTechone of the differences was that upphovsrätt could not be signed away12:56
amsit can.12:57
amsin sweden at least.12:57
amsand in germany.12:57
amsthe only thing you couldn't sign away was droit de authour or whatever ... in france/germany/some-other-places12:57
amswhich isn't the same as "copyright"12:57
_franck__FWIW: droit d'auteur ;)12:59
sb0jeremypbennett, I suppose it's the same for spr-defs.h? btw where's the original file?13:16
jeremypbennettsb0: spr-defs.h is different. It certainly has lots of IP in it, and is GPL with many owners!13:59
blueCmdstekern: pff14:07
stekernspr-defs.h is just register definitions, it's beyond senseless to have a license on it...14:08
stekernsb0: there's a GPLv2 version of that file, but not any non-gpl versions:
stekernif you absolutely want a non-gpl version, you can generate one from this:
stekernif you do, please contribute it back though ;)14:17
blueCmdolofk: XC7K325T-FFG900 (speed grade -2)14:26
sb0stekern, and regarding your code in milkymist-ng-mor1kx - what's the license? do you like 2-clause BSD?14:48
blueCmdomg. stekern, apparently the atomic test cases now pass :S14:52
mohessaiddoes or1ksim allocate all space indicated under the RAM in memory section? "size =0x0200000"14:53
stekernsb0: feel free to put 2-clause BSD on anything I've written there14:55
sb0ok, thx14:56
blueCmdstekern: have a read through when you feel like it - I tried to keep the amount of bullshit quite low, and apart from quite heavy code reuse in the two functions in or1k.c, I think it should be quite straight forward14:59
stekernblueCmd: nice! I'll take a look. In return, I give you your daily SMP commit -
blueCmdstekern: so what happens if you call cmpxchg there with like a char ptr?15:07
blueCmdsurely l.swa will write stuff to things surrounding the char?15:08
LoneTechI expect swa means store word atomic. I wouldn't expect it to do bytes.15:13
blueCmdyes, exactly15:14
blueCmdbut the fact that it takes a void pointer and doesn't protect itself like the xchg does makes me suspicous15:14
blueCmdin gcc I had to hack around that limitation by masking and aligning accesses15:15
LoneTechI see15:15
blueCmdbut I suspect some protective stanza would be enough, we probably shouldn't be using non-word sized values for atomics in the kernel since it's much faster operating on whole words15:15
stekernblueCmd: good question, I have the protection around the xchg as you can see. I think that cmpxchg is per definition 4 (or 4 and 8 for 64-bit archs).15:35
stekernprobably doesn't hurt to add the protection around it anyway though, the check should be optimized away anyway15:36
stekernlet's do that15:38
stekernblueCmd: looking at your commit now, I think you've managed to trim it down pretty nicely. A bit code duplication in the .c functions as you say, but otherwise16:53
stekernthere's one thing I'm wondering about, how does the cmpxchg loop work?16:53
blueCmdstekern: (kernel) I'm thinking that it _looks_ like the check is in runtime, but maybe it isn't. I know some lib I debugged used something like #define xchg(ptr, what) __xchg_##(sizeof(*ptr)) or something like that to produce a linker error19:10
blueCmdstekern: (gcc) the comxchg doesn't loop, it returns true or false if it succeeded or not19:11
stekernit's a compile test, trust me ;)19:14
blueCmdis it because it's inline?19:15
blueCmdor because it's -Osomething ?19:16
stekernwell, I can't say I can explain it in detail, but it's always called with an at compile time known constant (size(*ptr))19:25
blueCmdright, yes - if you're happy I'm happy!19:26
stekernand the fact that the link will fail if the if (size != 4) condition ever is true, we can be pretty sure that that if get optimized away ;)19:27
stekernI mean, the link will fail if that code didn't get optimized away19:28
stekern(gcc) yeah, I see that it doesn't loop, I was just wondered about the semantics of the operation19:36
stekernbut I see now that the builtin works like that19:37
stekernblueCmd: you're not going to believe your luck today, you get a *bonus* commit!
stekern*now* it's time for the spinlock implementations19:47
juliusbso how might I run a sim in fusesoc and get a waveform dump?21:13
_franck_fusesoc sim blabla --vcd --force21:15
* juliusb slaps his forehead21:15
juliusbit's right infront of me with --help21:15
juliusbsorry :)21:15
juliusbthe mor1kx-generic system doesn't want to build for me. It fails to find 2 VPI componenets, the elf-loader.vpi and jtag_vpi.vpi. Any hintS?21:23
_franck_it depends on libelf21:23
juliusbAh hah. However, apt-get don't seem to know about it.21:24
juliusbReckon the best bet is just to download the source and build it myself?21:24
juliusbOK, actually, there's something available named libelf-dev.21:25
juliusbI presume that's it21:25
pgavini think21:26
pgavinyep thats it21:26
pgavinon debian testing21:26
juliusbnice one, thanks. that's done some more downloading and installing for me21:26
_franck_Versions >=0.152 has been shown to work, while 0.149 does not work21:27
_franck_oh that's mean it okay I guess ;)21:27
pgavinso it appears spr-defs.h is getting out of sync21:28
juliusbyeah I got the mor1kx bus $displays()21:28
juliusbAND when I ctrl+C'ed it (it also said No ELF file specified, which seems accurate) it said something about killing the RSP server. Way cool!21:28
pgavinI think I'm going to syncronize the copies of spr-defs.h that exist all over the place in the toolchain21:31
pgavinI was thinking of separating the NOP_* constants into its own header, maybe called or1ksim-nop.h21:31
pgavinunless anyone else has a suggestion21:32
juliusbit's not possible to have a single copy available to them all?21:33
pgavinit would be nice21:34
pgavinbut I think that's difficult to get working21:34
juliusbI can imagine.21:34
pgavinbecause or1ksim uses it, and has to be compiled first21:35
pgavinthen binutils uses it21:35
pgavinor1ksim has 2 copies, lol21:35
pgavinand the or1k-src tree has a copy for newlib and a copy for the gdb simulator21:35
juliusbI'm sure there's copies in every bit of software and development environment ever.21:36
juliusbAlthough, we install it now with the tool chain, don't we?21:36
pgavinI think so21:36
juliusb... and probably have done for a while, since you made it do that IIRC?21:36
pgavinI don't recall now21:37
pgavinbut possibly21:37
pgavinone of the copies in binutils should be the installed copy21:37
pgavinbut then or1ksim will have problems21:37
juliusbcool. Yeah, it's available in $PATH_TO_YOUR_TOOLCHAIN_INSTALL/include/spr-defs.h21:37
pgavinI mean, if we remove it from or1ksim21:38
juliusbsure, you definitely need it to build or1ksim21:38
pgavinso at least on my machine the copy that was installed came from newlib21:39
pgavinwhich is probably ok21:39
pgavinalthough maybe it should be in libglass?21:39
juliusbyou could do something horrible like require or1ksim exist and be installed on a system before the tool chain can be built, and the tool chain picks up the versino of spr-defs.h (probably rename it to something like or1k-spr-defs.h) from some system include directory21:40
juliusb(libgloss stuff) yes, that sounds about right21:40
pgavinor maybe just put it in a completely separate package21:41
pgavinor something21:41
juliusboh yeah21:41
pgavinthat's probably the best idea21:41
pgavinand over time we can make other packages use it21:42
juliusband that's the only place it exists? and gets installed before all other bits of the tool chain can be built?21:42
pgavinyeah, that's what I'm thinking21:42
juliusbpretty neat21:42
pgavinit only has a make install command21:42
juliusbso... when I do --help on a "fusesoc sim mor1kx-generic", is it due to the fact the system has the jtag VPI core and the elf loader core, that I see the --jtag-vpi-enable and --elf_load ELF_LOAD switch options in the help output?21:46
juliusbif so, I want to buy the person who had the idea to do that, a beer21:47
juliusbomg, so so cool21:47
juliusbmor1kx-generic just printf'd some stuff21:47
juliusbwhich I just put into a C file21:47
juliusband passed with --elf-load21:48
juliusbthis is too easy :)21:48
pgavinstefan says it will boot linux21:48
pgavinbut I haven't tried it21:48
pgavinbut yes, it's pretty neat21:48
juliusbthat involves me compiling a kernal :-/21:48
juliusbkernel, even, plus busybox or ... debian!21:48
juliusbI want to see icarus run debian21:49
_franck_juliusb: yes those paramaters are plusargs defined in cores files21:49
juliusboh awesome, so it just scrapes all of the plusargs and puts them out. that's so so good21:49
blueCmdstekern: lgtm!21:49
* blueCmd is in Amsterdam this week21:50
blueCmdthis is a very weird and wonderful place21:50
pgavinindeed it is21:51
blueCmdolofk: really cool writedown21:58
blueCmdolofk: also, I talked to flameeys and he was "no way I'm going to let Gentoo be second to Debian in porting to OpenRISC" - so maybe he'll join our special family ;)21:59
_franck_pgavin: so you are intresting to come to sophia antipolis ? I live there if you want some informations22:01
pgavin_franck_: cool22:03
pgavinI'm thinking about it22:03
pgavinbut my fiancee knows almost zero french22:04
pgavinso it would be difficult22:04
_franck_we are not the most bilanguale nation in the world ;)22:05
_franck_far from that22:05
_franck_but at least here, close to sophia there is a lot of foreign pepole so it shouldn't be that bad22:06
pgavinshe says she'd be willing to learn french22:07
pgavinand mine isn't very good at this point, so we'd be practicing together lol22:08
pgavinI can hold a conversation, but only barely :)22:08
_franck_great, that's a start22:09
pgavinmy mom is french, and I grew up speaking it, and speak with her occaisionally (and with other family members) but since I live in the US it's hard to keep up with it22:10
juliusbpgavin: when are you over? any chance you'd be on the continent for ORCONF?22:11
_franck_ah it's in your genome, that will be fine ;)22:11
pgavinjuliusb: perhaps, it's still a bit too far off to be sure22:13
pgavinI'm trying to graduate and look for a job, etc.22:13
pgavinsent a mail to the list about the headers thing22:16
_franck_juliusb: I had ti fix your cfi_ctrl core to make it work with mor1kx. Your core rely on the fact that during wb 32bits access, bits [1:0] are still valid.22:16
_franck_however, as per ths wb spec, mor1kx set bits [1:0] to "00"22:17
_franck_this is the fix:
juliusb_franck_: ah yes I noticed that. Do you want me to commit the fix to opencores repo?22:22
_franck_for now, I just added a patch in orpsoc-cores22:23
_franck_may that would require some more testing. Not sure it works with a 8bits NOR bus22:24
pgavinhmm.. spr-defs.h is GPL322:44
pgavinthis might be a problem22:44
pgavinshould be LGPL3?22:44
--- Log closed Wed May 14 00:00:47 2014

Generated by 2.15.2 by Marius Gedminas - find it at!