IRC logs for #openrisc Thursday, 2016-08-11

--- Log opened Thu Aug 11 00:00:20 2016
olofk_blueCmd_: Happy birthday :)08:05
olofk_shorne: Ah ok. That makes sense08:06
blueCmd_olofk_: thanks :D09:09
mafmcongrats blueCmd_ !09:22
mafmbtw, blueCmd_, you appear in the "special thanks" section of my talk in the risc-v conf :P09:23
-!- Netsplit *.net <-> *.split quits: Xueming, bandvig, _franck__09:26
blueCmd_mafm: I did see that! olofk_ tweeted that I was famous - thanks a lot man, made my day :D09:36
-!- blueCmd_ is now known as blueCmd09:37
mafmblueCmd: well, all I can say is... credit where credit is due :D09:41
blueCmdthanks :P09:55
-!- Netsplit over, joins: bandvig10:00
mafmblueCmd: I expect to join me in 2038 or so, when gcc support for risc-v is upstreamed :)10:57
blueCmdhaha, will do!10:58
ZipCPUolofk: I just got an extended Quad SPI flash controller up and running.  You should find the test bench for this core easier to incorporate into FuseSoc--should you so wish.18:48
ZipCPUYou'll find the (new) code on OpenCores, in the qspiflash project.18:48
andrzejrZipCPU, what HW do you use for testing (board, QSPI slave)?18:49
ZipCPUI've been testing this new controller on the Arty platform.18:49
ZipCPUThe older controller, also in the same directory, has been tested on Digilent's Basys-3 and CMod-S6 platforms.18:50
ZipCPUYou can actually find the hardware files, both Verilog and C++, that I've been using in the openarty project on OpenCores.18:50
andrzejrwow, that's a lot of good stuff18:54
ZipCPUAnything you are looking for in there?18:54
andrzejrI see you have WB<->QSPI Flash bridge, nice touch.18:54
ZipCPUIt was actually necessary on the old controller to integrate into the CMod-S6.  The WB-QSPI bridge allowed the ZipCPU I was running to run from flash memory just as it would any other memory save that flash was slow.18:55
andrzejrIn the past I was working on nexys4 board. It uses a QSPI flash as well.18:55
ZipCPUI think the older controller should work with the Nexys-4 board.  Almost all of those flash chips are nearly the same.18:56
ZipCPUThe newer controller ... took some more work.  It had a different set of registers, a bit of a different interface, and I wanted to run the flash at 100MHz instead of 50MHz.18:56
andrzejrIs GPL a deliberate decision?18:58
ZipCPUYes.18:58
ZipCPUWith an appropriate incentive I could make an individual incentive ... ;)18:58
ZipCPUindividual exception ... (individual incentive ... gosh--sometimes I don't believe what I type!)19:00
andrzejrI'm not against GPL in general, but it just doesn't work for HW. That is, there is no way to legally make an open HW. The main culprit is the definition of "system libraries".19:14
andrzejrDid you write your own DDR3 controller?19:18
kc5tjaZipCPU: The Quad-SPI controller, does it allow you to expose an SPI flash chip to the host CPU as if it were a parallel flash chip?19:37
kc5tja(forgive me if you already mentioned this; scrollback is not easy for me to read at the moment)19:37
kc5tjan/m19:38
kc5tjaI see that you already answered my question.  :)19:38
ZipCPUkc5tja: Sorry --- stepped away for supper.  Yes, you can run programs directly from the Quad SPI flash controller if you wish.  Sure, it's slow, but you can do it.19:42
kc5tjaNice.19:43
ZipCPUandrzejr: The DDR3 controller is (sadly) a work in progress.  I <though> I was almost there: I had a simulation built, a simulator running, fully operational test benches, etc.19:43
ZipCPUThen I discovered I made a *big* mistake in understanding the spec, so ... now I get to start that over from scratch.19:43
kc5tjaI'd have to ask for a license exemption though for Kestrel project (MPLv2 instead of GPL).  MPLv2 is compatible with GPL, but the reverse relationship doesn't hold.19:45
andrzejrHow do you deal with SerDeses and phase interpolators? Do you use ones from Xilinx (encrypted)?19:45
ZipCPUkc5tja: Let's discuss it offline--you can e-mail me at dgisselq (at) opencores.org.19:46
kc5tjaZipCPU: Way too early yet.  I'll chat w/ you when the time is right.19:46
kc5tjaWon't be until next year at least.  :(19:46
ZipCPUandrzejr: For the DDR3 controller, I am going to need to user xSERDES elements.  I thought I was going to be able to get away with xDDR elements only, and was ... corrected along the way.19:47
ZipCPUkc5tja: Under the current license, you should be able to at least make your Kestrel computer, even with the Quad-SPI flash controller, and then know if it works.19:48
ZipCPUIt's when things come to distribution that things get ... interesting.19:48
kc5tjaRight.19:48
kc5tjaOK, I'm giving up on implementing a native RISC-V CPU for now.  The debugging complexity is just intractible.21:59
ZipCPUReally?21:59
* kc5tja goes back to using a Forth CPU, and writing a RISC-V software emulator instead.21:59
kc5tjaIt's well and truly beyond my skills.21:59
ZipCPUIs this specific to RISC-V?21:59
kc5tjaI've tried four different times, each attempting a different approach to tackle the problem.22:00
kc5tjaNo, to RISC in general.  It's just too complex for me to wrap my head around.22:00
ZipCPUHow are you trying to handle debugging?22:01
kc5tjaI want to see a working computer, even if it utterly under-performs, than show up to RISC-V workshop empty-handed a third time.  :(22:01
kc5tjaUnit tests.22:01
kc5tjaTest benches.22:01
ZipCPUBut ... you've done CPU's before.  How and why are RISC CPU's different?22:02
kc5tjaI've done MISC cores before.22:02
kc5tjaThose are 300 to 600 lines or Verilog for the _complete_ core.22:02
kc5tjaRISC at a minimum takes up several thousand lines of Verilog, no part of which is easily modularizable.22:02
kc5tjaThat's why I'm going to go back to using a Forth core.22:02
kc5tjaThis is something I know I can get working.22:03
ZipCPUHmm ... I like to think of my own core as being a RISC core, and I was able to separate some of the parts into modules--certainly not all.22:03
ZipCPUThe memory, divide, ALU, instruction decoder, and prefetch all have separate cores from the main core.22:03
ZipCPUThe main core, though, is still ... pretty ugly.22:04
ZipCPU(Ugly = 1.8k lines of code)22:04
ZipCPUBut ... hold on, let me understand something ... is this because of the large number of instructions the RISC-V CPU supports?22:04
ZipCPUHave you seen my CPU ISA complexity comparison?22:06
ZipCPUkc5tja: You might find http://opencores.org/websvn,filedetails?repname=zipcpu&path=%2Fzipcpu%2Ftrunk%2Fdoc%2Forconf.pdf of value.22:14
kc5tjaThe # of insns isn't that much; only 56 or so for my CPU design.22:14
ZipCPUI put it together to try to capture the ... complexity of the various CPU ISA's out there.22:14
kc5tjaAnd from an instruction decode POV, I only have 24ish minterms, so that's not much.22:14
kc5tjaBut, for some reason, I'm running into a situation where I deliberately feed it a malformed instruction, and the "undefined" flag isn't being set.22:15
kc5tjaI'm like, if I can't even get THAT working, there's no hope.22:15
ZipCPUHow many bits does it take to determine that an instruction is malformed or undefined?22:15
kc5tjaUltimately, all 32, because CSRRx instructions throw and exception if you give an unsupported CSR register.22:16
kc5tjaBut, typically, 9 to 12 bits.22:16
ZipCPUOuch!22:16
kc5tjaYeah.22:17
kc5tjaThe instruction encoding is very obviously optimized for ASIC layout, and not at all for FPGAs.22:17
ZipCPUThis is absolutely fascinating ... it sounds like your experience is starting to confirm one of my "theses" regarding the ZipCPU.22:18
kc5tjaSo, right now, I'm planning on just implementing a wide Forth CPU, using block RAMs as a ROM to hold the RISC-V emulator, so external modules never know the difference.22:18
ZipCPUThesis: modern FPGA-based soft-core CPU's have instruction sets that are *way* too complex.22:19
kc5tjaOnce THAT is working, which I HOPE I can repeat a success on, then I hope to implement RISC-V instruction decode-to-stack-ops approach, like x86 pre-decodes to RISC-ops.22:19
ZipCPUYou mean, like Just-In-Time hardware compilation?22:20
kc5tjaThat should let me get back a lot of the lost performance.22:20
kc5tjaYep22:20
ZipCPUAnd you think that will be ... <gasp> simpler??22:20
kc5tjaAll RISC-V instructions have a corresponding (and static) equivalent Forth code sequence.22:20
kc5tjaNo.22:20
kc5tjaIt will be more complex overall.22:21
ZipCPUHmm ... quick question: how many lines of code are you working with in your (now) failed attempt at RISC-V?22:21
kc5tjaBut if I can get a *success* on the Forth CPU idea (that will be simpler for sure), the instruction predecoder should not be too much harder.22:21
kc5tjaLet me check.22:21
kc5tjaDisclaimer: I have modules written but they're not even wired up yet.22:22
ZipCPU(Understood)22:22
ZipCPUSLOC (Software Lines of Code) measures are like MIPS (Meaningless Indicators of Processor Performance).  Their both easy to measure, both feel good to report, and both are probably just about as meaningless--but I'm asking anyway :)22:24
kc5tja261 for instruction decode, ALU, and GPRs combined, but 140 for instruction decode.22:24
kc5tjaALU and GRPs work -- those I've tested separately.22:24
kc5tjaSo the bug is _somewhere_ in instruction decode.22:24
ZipCPUHow many lines of code determine what constitutes "undefined"?22:25
kc5tjaAlmost all of them when you expand the logic equations.  :)22:25
ZipCPUYikes!  That bad?22:26
kc5tjaLet me just point you to the source.22:26
ZipCPUDo you have it posted somewhere?22:26
kc5tjahttps://github.com/sam-falvo/polaris/blob/V3/rtl/verilog/polaris.v22:29
kc5tjaline 126 is where undefined_o is assigned.22:30
ZipCPUThis's gotta be harder than it looks: do you know what values each of those components has taken on?  i.e., which component thinks you have a valid instruction?22:32
ZipCPUOoh ... linse 26-54 ... painful!22:32
ZipCPUWhat are you using for a simulator?  Does it give you insight into what is going on within the core?22:34
kc5tjaIcarus Verilog22:36
ZipCPUHmmm ... am I being spoiled by using Verilator, and getting full insight into all of the wires and registers internal to my core?22:39
ZipCPUkc5tja: Gonna need to chat later, my eyes aren't staying open.22:40
kc5tjaI could use something like GtkWave, but with logic as simple as that (and, while voluminous, it IS simple logic), I shouldn't need to.22:41
kc5tjaZipCPU: 'night!22:42
--- Log closed Fri Aug 12 00:00:21 2016

Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!