Thursday, 2020-05-14

*** tpb has joined #litex00:00
*** Skip has joined #litex00:26
*** CarlFK has quit IRC00:36
*** rohitksingh has quit IRC00:47
*** _whitelogger has quit IRC01:00
*** _whitelogger has joined #litex01:05
*** _franck_ has quit IRC01:11
*** _franck_ has joined #litex01:21
*** _whitelogger has quit IRC03:12
*** _whitelogger has joined #litex03:14
*** Degi has quit IRC03:27
*** Degi has joined #litex03:27
*** Skip has quit IRC03:33
*** _whitelogger has quit IRC03:48
*** _whitelogger has joined #litex03:56
kgugalaCarlFK I pasted a link where you can find prebuilt toolchains04:32
*** CarlFK has joined #litex05:02
CarlFKkgugala: 1. Connect to NeTV2 board using JTAG (ARM-USB-TINY-H JTAG adapter was used)05:13
CarlFKI don't have a jtag anything, but I do have a pi and some jumpers05:14
kgugalathat should also work05:14
kgugalathis step is for programming the bitstream05:14
kgugalaif you use rpi, skip the make gateware/reload step05:16
kgugalathis target is for programming FPGA from host PC via jtag05:17
CarlFKdo I need to hook up to the jtag headers on the netv2, or is the 20 pin connector do that too?05:24
kgugalaI never used rpi with netv205:31
kgugalaI suppose the 20 pin connector is rpi format05:31
kgugalaif you have Xilinx platform cable you can connect it via jtag header05:32
CarlFKI don't have that either05:42
*** awordnot has quit IRC05:43
*** awordnot has joined #litex05:43
*** rohitksingh has joined #litex06:00
*** kgugala__ has joined #litex06:14
*** rohitksingh has quit IRC06:14
*** kgugala97 has joined #litex06:15
*** kgugala has quit IRC06:17
*** kgugala__ has quit IRC06:19
*** rohitksingh has joined #litex06:32
*** kgugala97 is now known as kgugala06:46
bunnieThe 20-pin connector is designed to plug into an RPi so you can use openOCD running on the Pi to talk directly to the FPGA. It also maps the UART to the RPI's UART07:04
bunnieJust make sure you plug in the RPi aligned to the board correctly. A few people have been off by one row and well, it didn't end well for their hardware.07:05
*** kgugala has quit IRC08:27
*** kgugala has joined #litex08:27
benhFolks that have a long FPGA experience around here... one thing that's been bugging me with microwatt on Arty for a while...09:06
benhwhen building with litedram (it *looks* like it's only happening in that case so far, ie, clock comes from litedram's PLL), when starting up09:06
benhthe messages out of the UART are garbled for a few dozen/hundred characters then are ok09:07
benhif I hold the core stopped for a second or so at reset then start it, the problem goes away09:07
benheverything is fine in sim09:07
benhif I make the core do a loop of a few dozen thousands of dummy reads from the UART status before printing anything out it's ok09:08
benhPaul scoped the UART output and the bit duration looks fine09:08
benhthis has been eluding us for ages09:08
benh(it's not a LiteX UART, some simple "potato" uart we picked up ages ago, we'll replace it eventually, but it seems ok, I fixed a bug or two in there but nothingg so far that had any impact on that phenomenon09:09
kgugalabenh looks like core's reset is reasserted before the pll is locked09:09
kgugala*deasserted09:09
benhkgugala: the core reset comes from the soc reset which comes from the reset controller which doesn't even start countingg until the pll_locked signal is 109:09
benhkgugala: but maybe we have an obscure bug in there09:09
kgugalacould be09:09
benhkgugala: but yeahm that was my first reaction too...09:10
benhI've never managed to use chipscope successfully but I can try routing those signals to pins and use an actual scope09:10
benhI can probably borrow one and find a crappy uSB one somewhere09:10
kgugalathe other option is that the pll is reset incorrectly. AFAIK pll has some strict reset routine09:15
kgugalaI mean Xilinx 7 series pll09:16
benhOk. I wonder...09:17
benh_florent_: I notice arty.py creates one S7PLL09:17
benh_florent_: with all the clocks out of it, including iodelay via an S7DELAYCTL09:18
benh_florent_: however, litedram_gen creates 2 PLLs, one sys_pll and one just for iodelay09:18
benh(without specifying a speed grade for the second one)09:19
benhNow .. I dont' know that much about Artix PLLs, but I wouldnt' mind knowing if there's a rationale for this ;-)09:19
_florent_benh: i'll fix the missing speedgrade on the second PLL09:20
benh_florent_: so why two ?09:21
benh_florent_: the LiteX standard arty.py seems to create only one ...09:21
benhalso, am I getting lost in migen python or is LiteX not actually using pll.locked ?09:21
_florent_benh: a second PLL is used in LiteDRAM to allow more frequency steps (since it's difficult to meet generate both sys_clk/iodelay_clk from a single PLL)09:22
benh(note that I didn't see a problem with the LiteX generated microwatt, only with the standalone one + litedram, so I'm looking at differences)09:22
benh_florent_: ok but on the limited "scope" of an Arty, a single is enough then ?09:22
_florent_benh: yes, and we could eventually try to use only one if we are able to generate a working configuration with only 1 PPLL09:23
benh_florent_: ok, not a big deal for me... unless you think that could be behind some of my weird issues above ...09:24
benh_florent_: iodelay is only used internally to litedram right ?09:25
benhso why is it ok for LiteX to not wait for pll.locked before lifting reset ?09:26
_florent_benh: if you are using IODELAY primitives, you need to have at least one IDELAYCTRL in the design09:26
benh_florent_: ok, I think litedram is the only one that does in my current design09:26
benh_florent_: so that's probably not related to that weird issue09:26
_florent_the targets in LiteX are using the pll.locked: https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/clock.py#L9709:27
tpbTitle: litex/clock.py at master · enjoy-digital/litex · GitHub (at github.com)09:27
_florent_benh: if you share a project i can build easily, i could investigate a bit09:28
benh_florent_: I would love that but beware, it's microwatt fusesoc project in vhdl :-)09:30
benh_florent_: let me try to investigate a bit more first, esp. since you probably wont' be able to regenerate litedram on it with its current sccripts until we finalize our current work and I update microwatt to match it upstream09:30
benh_florent_: but I'll definitely take your offer if I draw a blank in the next few days :)09:31
_florent_benh: ok, it's easier for me to investigate if i can just have an archive with the sources and small script to build the design.09:31
benh_florent_: yeah ... "small script" means install/run fusesoc sadly09:33
benh_florent_: at least for now ... though that's not hard to pip install it09:33
benhand fusesoc generates a xilinx prj09:33
benhanyway, I'll dig a bit more.09:34
benh_florent_: the user_reset that comes out of litedram standalone is what I feed as reset to the rest of my loggic09:34
benh_florent_: does it wait for pll_locked already ?09:34
benhhrm ... actually I don't .. I must have hacked that a while ago... I use pll_locked and feed that into the reset controller09:36
benhbut I use it as a sync signal... I dont' have synchronizers there, I sample pll_locked on a sys_clk edgge09:36
benhmaybe that's wrong...09:37
benhshould I treat pll_locked as asynchronous ?09:37
_florent_pll_locked is currently asynchronous yes, but i could make it synchronous to the sys_clk09:38
_florent_benh: you could also use user_rst that is synchronous to user_clk09:40
benh_florent_: is user_rst guaranteed to be only deasserted until after pll is locked ?09:40
benhI'm building a test with synchronizers on pll_locked see if that makes a difference09:40
_florent_user_rst is only deasserted when the pll is locked yes09:41
benhwe have this crappy reset  controller someone wrote (I forgot whome, maybe anton) which uses a counter to delay reset release09:41
benhbut it doesn't have synchronizers on the main reset and pll_locked inputs09:41
benhdespite being a synchronous circuit09:41
benhmaybe it's going a bit nuts09:41
benh_florent_: so I could just use user_rst as a clean synchronous source of reset then, great09:42
benhHrm...09:56
benhtook out our custom reset controller and just used user_rst out of litedram as the SoC reset (core reset delayed 64K clocks), and the problem still occurs09:56
benhfun .. :-)09:56
benhI'm even wondering whether there's a voltage drop when everything comes up... I'm powering the Arty off USB09:57
benhI should try an external psu at some point09:57
benhanyway, dinner time :)09:57
_florent_benh: is the behavior different at the first startup after loading the bitstream and with a manual reset?10:24
*** scanakci has quit IRC10:36
benh_florent_: we don't have a manual reset but I'll add one and test10:46
benh_florent_: we do have a manual soc/core reset but that doesn't reset litedram (somewhat on purpose)10:46
benhI'll try something later, let me first  test what you committed and the system.h include on csr.h, I want to get that stuff done and dusted :)10:47
benh_florent_: is that safe to assume you'll eventually merge my rework-csr-accessors ?10:49
benhor rather csr-access-rework :)10:50
benh_florent_: so the whole inclusion of system.h gets a bit messy in the generated csr.h10:57
benh_florent_: my thinking is that in gen_csr_header, if with_access_functions, I'll just unconditionally hw/common.h, which itself will include system.h10:58
benh_florent_: with my rework, hw/common.h will do the right thing cs. CSR_ACCESSORS_DEFINE10:58
benh_florent_: which is to define all the "new" fancy high level ones based on the simple ones and leave the simple one to the platofrm10:58
_florent_benh: i'm not the best qualified to evaluate theses changes, so if somlo, xobs are happy with it, i'm fine merging it11:00
xobsSure, okay by me.11:00
benh_florent_: wait11:05
benh_florent_: let me merge the system.h addition into that patch11:05
benhand fix some leftover commented out code that was in there while at it11:05
benhxobs: somlo: Please re-check that csr-access-rework11:11
benhI've folded in the suggestion of including system.h to give the platform/cpu a chance to override CSR_BASE and CSR_ACCESSORS_DEFINED and provide inline simple accessors11:11
benhI'm hoping it won't break anything but I would appreciate your eyes (and possibly testing)11:11
benh_florent_: if that passes muster I think that's all I need for standalone litedram on microwatt, we're good11:12
benh_florent_: on another note...11:17
benhpaul noticed that loading a cache line from litedram seems to take11:17
benhabout 15 cycles for the first read and then about 12 cycles per read (64-bit)11:17
benhat the moment, my wb<->litedram bridge is a bit dumb. Each 64-bit read is a complete litedram cycle where I use either the top or bottom half of the data11:18
benhnow I haven't looked too closely at how I could pipeline/stream the user port there ... would it be possible to send a single read command and then pump data out of the read port multiple times ?11:19
benhor it's just the speed I should expect and the best I can get might be to cache the other 64-bit of data coming in for the next access ?11:19
benhI've tried but I've found myself so far unable to understand the Hw design from reading the python mygen stuff :) It's ... very hard to parse for someone not experienced11:22
benhie. do you need a CMD phase for each transfer ?11:24
benhis 12 cycles per transfer of 128 bytes something expected ?11:24
benhor can I pipeline N commands and separately do N data cycles to get the data ?11:26
benh(if yes, how much is N practically speaking ?)11:27
benhxobs: somlo: doing some more changes to that branch... I don't like that csr.h includes hw/common.h... it might make things harder for your etherbone cases...11:33
benhxobs: somlo: done. Pls check  (and see my response on github)11:39
benh_florent_: I think I get the gist of it ... with pipelined wb I should be able to turn each read or write on the wb into a "command" to the native port11:49
benh_florent_: and separately handle the data... let's assume I keep write simple for now, ie, I send a write command and write data together when both ports are ready11:50
benh_florent_: that mean for reads, I can send commands on each 'stb' from pipelined wb11:50
benh_florent_: and return data+ack on each valid i get on the read port completely independently11:50
benh_florent_: right ?11:50
benh_florent_: now, my wb is 64bit wide, the native port is 128... is there a gain in caching the last read data/address in my wrapper11:51
benh_florent_: to return the "other" half since that's typically the next thing happening on a cache line refill11:51
benh_florent_: or I may as well send another read command down to litedram ?11:51
benhif you don't have time to respond, I'll try this week-end to build some kind of test setup in verilog with a self-initializing litedram and a micron DDR model or something like that11:52
benhto experiment with11:52
*** Dolu has joined #litex11:53
_florent_benh: the 12cycles per transfer if because of the latency, when pipelining and in the ideal case (sequential accesses), you should be able to nearly write/read 128 bytes/cycle  (at least with a DMA).12:05
_florent_benh: we are currently working on an adapter for the LiteDRAM native interface that will be able to do the data width adaptation for both reads and writes12:06
_florent_so you will be able to request a 64-bit port directly from LiteDRAM and data width convertion will be handled internally12:07
benh_florent_: ok. In the meantime, is my undertanding of how the port work correct ?12:10
benhie, setting aside the width issue12:10
benh_florent_: and ignoring writes for which I'll, for now, just wait for both cmd and write port to be ready as today12:10
benh_florent_: for reads, I can send all the commands as I get the stb's from the pipelined wb12:10
benh_florent_: and separately retrieve the data & send data & acks to the wb as I get the valids from the read port ?12:11
benh_florent_: ie, is my undertanding correct that I always need a command per access, but I can pipeline a bunch of commands and do the data transfers from the read/write ports separately ?12:11
benh(in the order the commands were done of course, which gets messy if I mix up reads and writes but is nicely suitable for a string of reads such as a cache refill)12:12
_florent_yes it's correct, but there is no data buffering with the native interface, so that's possible you'll have to add Write/Read FIFOs12:14
_florent_for writes, once the command is accepted, write the data to the FIFO and LiteDRAM will request it when it will be able to tranfer it on the physical interface12:15
_florent_for reads, LiteDRAM is not handling the ready of the rdata stream (which would require buffering), so the data should be accepted when valid is set to 112:16
benh_florent_: ok so as a first step, writes are simple as I have the command and data as one "stb' on the wb, I can just wait for both ready to be 1 before I send it12:27
benh_florent_: (for now)12:27
benh_florent_: for reads, I can arrange to always be ready.. the way  pipeline wb works, I am in a cyc=1 cycle, I can always send ack+data back if I had commands12:27
benh_florent_: the master won't send commands if it can't handle the data12:28
benh_florent_: the only issue is the 64-bit vs. 128-bit but I can trivially handle that with a small latch until you have that sorted on your side12:28
benh_florent_: improving writes might require a fifo indeed12:28
_florent_benh: it will probably not work for writes, since the command will be acked before the write, so you need to be sure you won't send additional commands while waiting for the write to be acked.12:31
benh_florent_: right, that's what I'm doing now aleady, it's not fast but works12:32
benh_florent_: my plan is to eventually turn our BRAM into an L2 (with an option to keep it linearly mapped so we can still use it as boot "firmware")12:32
benh_florent_: at which point I'll probably pipeline both reads and writes as whole cachelines with a direct 128-byte bus between litedram and L212:33
benhbut right now it's more than my spare time can cope with, maybe in the next few weeks...12:33
benhfirst, once you've merged all that csr gunk and I've pushed the microwatt updates to anton, I want to gggo back to baby sitting your LiteX/microwatt intgration12:34
benhsee if I can get the external interrupt going12:34
benhetc...12:34
_florent_that would be nice, i should spend time finishing the ghdl-synth/verilator support to ease this work (this would also help for litedram integration)12:47
benhdefinitely13:16
Findebenh: has anyone tried running the microwatt RTL through commercial tools? I tried to use vhdlan from vcs yesterday and it was really complaining a lot13:56
somlobenh, _florent_: fwiw, commit 1e35b0e7 (still) works OK for me :)14:01
*** scanakci has joined #litex15:43
*** shuffle2 has quit IRC15:51
*** acathla has quit IRC16:39
*** lambda has quit IRC16:39
*** lambda has joined #litex16:41
*** Skip has joined #litex16:41
*** acathla has joined #litex16:53
*** Skip has quit IRC16:53
*** Dolu has quit IRC17:24
*** kgugala__ has joined #litex17:34
*** kgugala has quit IRC17:37
*** Skip has joined #litex18:08
*** _franck_8 has joined #litex18:09
*** _franck_8 has quit IRC18:11
*** _franck_ has quit IRC18:11
*** fjullien has joined #litex18:18
*** fjullien is now known as _franck_18:19
*** acathla has quit IRC18:30
*** acathla has joined #litex18:30
CarlFKbunnie: thanks.18:46
*** kgugala has joined #litex19:09
*** kgugala__ has quit IRC19:11
*** darren099 has quit IRC20:01
*** Skip has quit IRC20:21
benhFinde: Vivado for sure ;-) I think Mikey tried at some point a commercial tool for verilog conversion and it was .. painful21:40
benhFinde: it looks like VHDL 2008 support in tools is somewhat flawky21:40
benhsomlo: great thanks !21:40
CarlFKkgugala: http://paste.ubuntu.com/p/bV2nB8mysr/  application-specific initialization failed: couldn't load file "librdi_commontasks.so": libtinfo.so.5: cannot open shared object file: No such file or directory22:01
tpbTitle: Ubuntu Pastebin (at paste.ubuntu.com)22:01
Findebenh: I submitted a PR for some issues I saw trying to run the core through VCS22:01
benhI tried to use some more advanced VHDL features recently to define my wishbone as a record with unspecified address/data width22:06
benhand use subtype specialisation in places22:06
benhand/or generic types22:07
benhthese are quite nice features of vhdl 08 for making things a bit parametric... except they work with no tool22:07
benhat least ghdl bugs get fixed quickly... Vivado bugs, you get CRin and you hope your grandchildren will have a fix22:08
*** CarlFK has quit IRC22:08
benhFinde: can you ammend your commit to add a DCO ? (ie. Signed-off-by:...)22:10
benhFinde: I don't think Anton will merge anything without one  bcs lawers22:10
*** CarlFK has joined #litex22:11
CarlFKkgugala: make clean does something alarming: ssh [email protected] "sudo rm /lib/modules/\`uname -r\`/litepcie.ko"22:31
CarlFKfixed the  No such file with sudo ln -s libtinfo.so.6 libtinfo.so.522:41
*** Skip has joined #litex23:57

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!