<shuffle2>
daveshah: fwiw seems the syn_preserve is injected because of FX681 :...|Initial value on register arp_table_request_timer_count[23:0] is non-zero which can prevent the register from being packed into a block RAM or DSP. (occurs for a few other registers in ip/mac stack as well)
<shuffle2>
seems migen emits the initial value as an initial assignment in addition to putting it in the reset block, is it worthwhile to avoid that?
<shuffle2>
i had left the udp_loopback example in with my own logic, and the loopback path is what was causing timing failures (mostly because of this deoptimization, i'm thinking)
CarlFK has quit [Ping timeout: 272 seconds]
Skip has quit [Remote host closed the connection]
CarlFK has joined #litex
<shuffle2>
eh, is there any good way to do it? after some trial/error, seems like any nonzero value assigned in initial _or_ reset will cause synplify to warn/inject syn_preserve :(
<shuffle2>
strange ive never seen it on the rather sizable amount of other (native) verilog im pushing through synplify
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
<benh>
what would it take to make litex add a default_nettype wire to generated files ?
<benh>
serv is setting it to none, and litedram breaks
<benh>
(depending on order files are built by vivado, as it incorrectly carries the default from file to file)
<benh>
that or make litex use explicit wire in the module generated
futarisIRCcloud has joined #litex
HoloIRCUser has joined #litex
HoloIRCUser2 has joined #litex
HoloIRCUser1 has quit [Ping timeout: 240 seconds]
HoloIRCUser has quit [Ping timeout: 246 seconds]
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #litex
<shuffle2>
changing liteeth\examples\targets\udp_loopback\versa_ecp5.py to target ecp5um (instead of ecp5um5g) causes the timing issue on the plain example, as well. suppose that's why no one has noticed it until now
<shuffle2>
same size/speed otherwise, kinda curious :s
<_florent_>
shuffle2: we indeed have to optimize the timings of the LiteEth hardware stack on ECP5, it has been developed mostly for 7-series but hasn't been optimized yet for slower devices.
HoloIRCUser1 has joined #litex
HoloIRCUser has quit [Ping timeout: 246 seconds]
<benh>
Hrm ... standalone litedram with serv instead of vexriscv is smaller ... but also doesn't quite work :-)
<benh>
anything special to do other than including all the serv rtl verilog files in the project ? It builds, I get the banner but ..
<benh>
ah wait.. it comes up eventually but extremely slowly
<benh>
The system will continue, but expect problems.
<benh>
and the RAM init seems to fail
<_florent_>
benh: yes, since SERV is a lot slower, that's possible we need to modify the BIOS a bit to speedup the initialization
<_florent_>
benh: are you sure all the BIOS files have been recompiled for SERV (and you are not using old VexRiscv ones?)
<_florent_>
benh: be sure to remove the software build directory when switching CPU
<benh>
_florent_: I think so, but I'll dbl check. I'm using fusesoc so it should be clean but ...
<benh>
I'll try to build a LiteX one to compare, this is microwatt + standalone litedram with built-in serv for inits (works fine with VexRiscV mini)
<_florent_>
benh: ok, at least i remember having this issue in simulation when testing lxsim --cpu-type=vexriscv and then lxsim --cpu-type=serv without removing the build directory
HoloIRCUser2 has joined #litex
HoloIRCUser1 has quit [Ping timeout: 260 seconds]
<benh>
_florent_: ok, let me just build a standard LiteX SoC from scratch with serv see what happens...
<benh>
ERROR: [Synth 8-6735] net type must be explicitly specified for 'serial_rx' when default_nettype is none [/home/benh/hackplace/litex/litex-boards/litex_boards/targets/soc_basesoc_arty/gateware/top.v:6]
<benh>
:-)
<benh>
You need to fix the problem I mentioned above :)
<benh>
it's a Vivado bug but you know how long it takes Xilinx to fix anything ...
<benh>
fusesoc sets the default_nettype to none at the top of each .v file, vivado "carries" it over to the next file, and thus applies it to the litex generated ones who then fail to build
<daveshah>
That's the Verilog standard afaik
<benh>
so you can have either litex use explicit "wire" in module defs
<daveshah>
Nothing to do with Vivado
<benh>
daveshah: to carry it over to subsequent .v files ?
<daveshah>
Yes
<benh>
Odd ... I've read otherwise but maybe I'm wrong, I haven't read the standard
<benh>
it sounds very bogus to have a compiler carry such definitions to another compile unit
<daveshah>
There is an ambiguity as to whether default_nettype requires wire in "input wire" but I'm pretty sure the conclusion was it is
<benh>
so the fix here is either to make litex slaps a default_nettype back to wire on top of every generated .v file
<benh>
or use explicit "wire" in module definitions
<benh>
for now I'm just hacking serv to reset the nettype to wire at the end of each file as a temporary workaround
<benh>
_florent_: ok with the workaround above, serv based SoC comes up, inits RAM fine, not entirely sure what's wrong, I'll dig a bit more
<_florent_>
benh: for the default_nettype, can you create an issue on LiteX repo with a minimal example to reproduce it?
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
<benh>
_florent_: well, just checkout litex, try ./arty.py --cpu-type=serv :-)
<benh>
with Vivado 2019.2
<benh>
but yes, I can
<benh>
odd... serv is working now
<benh>
though its bus is so slow, the memory test is taking minutes
<benh>
the init per se is quick, the memory test is useless
<benh>
it's somewhat odd actually...
<benh>
Memtest OK
<benh>
Memspeed Writes: 10Mbps Reads: 16Mbps
<benh>
_florent_: what's the licence on LiteX generated .v files & binaries ?
<benh>
_florent_: for standalone litedram, the generator I did is too awkward for most users, they would have to install litex, it breaks when you change thinggs etrc... I'd like to ship pre-generated .v files and BIOS images with microwatt along with the scripts to re-generate
zyp_ is now known as zyp
<_florent_>
benh: that's the aim of the generators: allow users to easily reuse pre-generated cores without having to install/understand LiteX. The license is similar to LiteX (BSD-2)
<benh>
_florent_: thanks, that's perfect. I'll include some pre-generated stuff with microwatt then. I'll try to get you patches to fix LiteX tonight or tomorrow
<benh>
_florent_: serv does save a few % LUT usage but with the memory test taking minutes, it's not very useful :)
<benh>
_florent_: so I'll stick to built-in VexRiscV "Min" for now ...
<_florent_>
benh: the idea is to reduce the memtest size or do something more clever to speed up init with SERV
<_florent_>
benh: what difference do you have in resource usage between VexRiscV Min and SERV?
<benh>
_florent_: with the whole of microwatt I go from about 51% slice LUT down to 48% from memory
<benh>
_florent_: and a couple % down on registers as well
<benh>
I'd have to rebuild later if you want precise numbers, that's what I remember from earlier
<benh>
it's not huge at this point (on the Arty 35)
<benh>
_florent_: the standalone sdram init seem to hang with VexRiscV_Mini compared to VexRiscV
<benh>
_florent_: not sure what's up at this point... I did clean up build cache etc...
<benh>
same as before with serv, I get the banner and it stops after "BIOS built xxxx"
<benh>
it's odd ... I would swear it worked yesterday... ugh
<zyp>
how fast are you running serv? I assume it'll have on the order of 1/32th the performance per clock compared to vexriscv
<_florent_>
benh: i also remember having some hang with VexRiscv mini but haven't intestigated it
<_florent_>
investigated
<benh>
I wonder if I'm building the BIOS with the wrong options...
<sorear>
someone has found an actual use case for serv?
<benh>
sorear: it would be nice for initializing litedram "standalone" just bcs it's small ...
<benh>
yup !
<benh>
-march=rv32im
<benh>
litedram_gen doesn't pass the variant down so core.py assumes a full vexriscv
<benh>
unless I can specify it in the yaml, I need to dig
<zyp>
sorear, I figure it could be nice for running the software part of a usb stack in applications that otherwise wouldn't need a cpu
<zyp>
without having to handle control requests in gateware
<benh>
_florent_: ah ! litedram gen.py need to collect cpu_variant from the yaml
<benh>
and pass it down
<benh>
let me work around and see if that helps
<benh>
I
<benh>
I'll send you a patch if it does
<benh>
_florent_: works now. However, it takes several seconds to do the memory test which is a bit nasty
lambda has quit [Ping timeout: 264 seconds]
<benh>
_florent_: so ppc64 needs custom CSR access functions... where should i put them ?
<benh>
_florent_: I'd rather not add special ifdef's in hw/commmon.h... I could define CSR_ACCESSORS_DEFINED
<benh>
_florent_: is there an include file in cpu/ that's force-included before anything else ?
lambda has joined #litex
<benh>
oh my ... csr accessors in common.h are ghastly
<_florent_>
benh: i just tried to avoid any CPU specific code in the BIOS, so if possible, the custom functions should be put in the CPU directory. If this is not possible with the current structure, we could think about that
<benh>
_florent_: right, we might need cpu specific include that goes before anything else
<benh>
_florent_: also I really really really don't like how we access CSRs today :)
<benh>
doing unsigned long* accesses regardless of the size of the CSR for example
<benh>
and the csr_rd_* etc... casting integers into pointers etc... it's all rather gross
<benh>
finally _csr_rd always doing a 64-bit access is somewhat of a nonsense
<benh>
on 32-bit cpus with 8 bit CSR bus that means 2x32-bit bus accesses per byte of the CSR !
<_florent_>
benh: the one you are looking at are probably the one in common.h that are purposed to be the most generic, the bios is generating specialized CSR access functions in csr.h
<benh>
_florent_: anyways, sent you 2 patches to get microwatt going for now
<benh>
_florent_: yup
<benh>
_florent_: though the generic ones should be written more nicely too :) but before hacking that to death
<benh>
_florent_: I suppose we should first decide whether to ditch 8-bit CSR busses
<benh>
and stick to 32-bit and no funny games of CSR sizes
<benh>
bcs that would simplify things quite a bit
<benh>
_florent_: oh, oops, I didn't re-pull today :)
<benh>
_florent_: I also sent you a patch to litedram gen.py to grab the cpu variant
<benh>
_florent_: so MW will still break once we take out the hack to treat c******* as cache-inhibited and start requiring the use of the special instructions (or the MMU)
<benh>
_florent_: that's what we need to fix CSR accesses for
<benh>
so there's a bit of time, the hack can stay for a while
<benh>
so I'd rather you guys decide what to do with CSRs long run and whether to ditch those funky variable sizes things alltogether or not before I start hackign through it :)
CarlFK has quit [Ping timeout: 246 seconds]
<_florent_>
benh: what we could do is switching to 32-bit CSR as default and see if we need to keep 8-bit CSR for retro-compatibility or just remove it. Even if 8-bit is still supported, we could still add some restrictions for it it to simplify things (ie would not be supported by Linux SoCs for example)
<benh>
_florent_: hrm... I would still like to gget rid of the mess in hw/common.h but ok :)
<benh>
_florent_: at least we should probably make the generic _csr_rd/wr use the _simple ones and have only those latter be in ifdef CSR_ACCESSORS_DEFINED
<benh>
_florent_: so things like microwatt only need to redefine the simple read/write
<benh>
the generated csr.h is already just using csr_simple_read/write
<benh>
so that's fine
<_florent_>
benh: yes, we can try to have a simple solution for that. A few months ago, not all design were able to work with 32-bit CSR, for example being able to do the DRAM calibration with 32-bit CSR is a few months old
<zyp>
even more of a reason to standardize on one CSR size
<_florent_>
benh: so for you it seems to be a mess now, but it's because there is some history and because we worked hard to make 32-bit CSR possible and work on all designs
<benh>
_florent_: of course, I apologise if I come accross a bit more rude that I intend ...
<benh>
I've written my share of mess over time :)
<_florent_>
benh: no problem, but it's just that supporting both is probably temporary and now that all designs can use 32-bit CSR and since it also seem to be ok on resource usage, we can now discuss to see if we should keep 8-bit support
<benh>
tbh my main nitpick for the general case (not specifically linux) is the structure of the helpers in common.h ... the fancy _csr_rd/wr ones should be built on top of the "basic" ones and there should thus be only one pair of "basic" ones that do the actual HW access with the right size
<benh>
and which can then be easily overriden if a CPU needs extra nits such as memory barriers or special IO instructions
<benh>
and thus CSR_ACCESSORS_DEFINED would allow to re-define just those two (ie csr_simple_*) and the rest would just build on top... not hard, I could give it a go myself but not tonight
<benh>
ok
<_florent_>
benh: we are open to suggestions/ideas and if using 32-bit CSR work for all projects and simplify things, that's probably what we'll do
CarlFK has joined #litex
<benh>
_florent_: yup
<benh>
all good
<benh>
btw, I need the litedram patch I sent you merged for microwatt generator to work with vexriscv_min
<benh>
(to specify cpu_variant)
<benh>
I haven't yet figured out how to fix litedram gen for cpu type "None", that's for another day, it seems more intricate
<benh>
sso for now microwatt+litedram will use vex
<somlo>
glue them back into 8, 32, 64, 128, etc. bit wide "compound" registers :)
<somlo>
benh: as the person to blame for the common.h "ghastliness", using [] indexing on an `unsigned long *` in `_csr_[rd|wr]` felt more expressive than `MMPTR(a)` or calling `csr_[read|write]_simple()`. Besides, those were (re)added for backward compatibility with externally written bios code by downstream. And they had to support multiple (8/16/32) subregister data widths, all of which were aligned at either 32 or 64 bits, depending on the CPU. And try to
<somlo>
so if you want to apply some additional awesomeness to that ghastly mess, I'm super excited to learn how one would do it better!
<benh>
heh
<benh>
somlo: it's hard to write that sort of stuff without ending up with a mess ;-) Look at the MMIO accessors in Linux ...
<_florent_>
somlo: you are the one we should thanks for allowing 32-bit CSRs to be used in all designs :) Most of the mess probably comes from the various configurations that need to be supported which make things complicated, as discussed just before, if limiting the configurations can help simplifying things, we should probably go in this direction
<benh>
somlo: I'll do some suggestions when I'm not about to fall asleep. The key thing though is that you really want to isolate the functions that do the actual HW access and have as few of these as possible
<benh>
somlo: and build the other "fancier" stuff on top of these. The reasons come from a number of factors such as the need for CPU specific memory barriers or even special instructions to do that type of MMIO access
<benh>
somlo: for example ARM and powerpc in theory need memeory barriers. I suppose none of the CPUs supported by LiteX today really re-order accesses but that's not an impossibility :)
<benh>
somlo: or you could end up with x86 style split IO bus with inb/outb style instructions (yuck ,.. but heh, they do exist)
<benh>
somlo: also I would strongly suggest keeping the address argument as a pointer all along
<benh>
anyway, off to bed !
<somlo>
benh: good night, sleep tight -- talk again tomorrow :)
<somlo>
_florent_: of course, if we *do* get rid of 8/16 bit csr data widths and go with 32 exclusively, we can totally simplify that crazy setup in common.h (but that almost feels like cheating now after all the hardship) :D :D
<somlo>
(not that I'm against simplifying things in any way, and 32-bit-only csr-data-width is probably the right thing to do)
<_florent_>
shuffle2: i wrote the ECP5 PLL code yes (mostly reading the docs and testing on hardware) but haven't really compared it to clarity results, so if you find obvious improvements, we could integrate them
<_florent_>
somlo: i think for now what we can do is: default to 32-bit, only support 32-bit on Linux SoC (if that can simplify upstreaming the Linux patches) and keep support for the other CSR data-width until we are sure that 32-bit work fine for all configurations and that keeping others configuations is not useful. So i will change the default to 32-bit and see if we have complains :)
futarisIRCcloud has joined #litex
gregdavill has joined #litex
<gregdavill>
benh: fyi, serv doesn't have a hardware multiplier. So you need to compile with -march=rv32i.
<gregdavill>
Also this is the same reason memory tests are slow. For standard tests the "random" generator is multiplying some numbers. Which needs to be emulated in sw.
<gregdavill>
Which on a serial CPU where everything is *32 clocks, will be slower than Vex.
<zyp>
shuffle2, looks to be 100 / 1 * 5 / 4, vs 100 / 4 * 5 / 1, end result is the same, difference is just in whether the division happens before or after the VCO
<zyp>
although, according to the ECP5 datasheet, the config from clarity falls outside the f_VCO range specced in the datasheet (400-800 MHz)
<shuffle2>
the ui actually says the vco is 625mhz
<zyp>
oh, my bad
<zyp>
hmm, no, that doesn't add up
gregdavill has quit [Ping timeout: 256 seconds]
<zyp>
ah, yes it does, the clarity config is 100 / 4 * 5 * 5 for the VCO and / 5 for the output
<shuffle2>
ah
<zyp>
I'm still unused to this pll structure, I forgot that the feedback path runs through both the CLKOx_DIV and CLKFB_DIV, so you get a 25x multiplication, not 5x
<zyp>
anyway, both configs are within the legal ranges then
<zyp>
100 / 1 * 5 / 4 vs 100 / 4 * 25 / 5
<zyp>
_florent_, I also found the answer now to the question we were discussing some weeks ago on CLKI range
<zyp>
f_PFD is the frequency after the CLKI_DIV, has a specified range of 10-400 MHz, so the 10MHz minimum is indeed after dividing
<zyp>
although the datasheet also mentiones that «For f_PFD < 10 MHz, the jitter numbers may not be met in certain conditions.»
<zyp>
which sounds to me like «you can go lower, but we can't give guarantees about jitter then»
<_florent_>
zyp: thanks, in your case allowing a lower frequency was enabling you to generate the 48MHz with a single PLL right?
<zyp>
yes, it's been working fine so far
<_florent_>
zyp: ok so that could be interesting to keep this, or at least allow it and create a warning if CLKI is bellow the specified range
Skip has joined #litex
spacekookie has quit [Quit: **agressive swooshing**]
spacekookie has joined #litex
<somlo>
_florent_: after b0578580 (litex) and da61aab (litex-boards) if I try to build a rocket+litex design (on either nexys4ddr or trellisboard), it just stops after building the bios and never goes into vivado (or, respectively, yosys/nextpnr)
<somlo>
no error, just declares victory once the bios is compiled :)
<_florent_>
somlo: indeed, you now have to add --build to build the gateware
<somlo>
aaaah
<somlo>
ok, let me update my bash history :D
<somlo>
(I just up-arrow and hit enter, if things don't work the way I expect then I start asking :D )
<somlo>
_florent_: thanks, I'm back in business now :)
<somlo>
_florent_: does that also apply to litex_sim.py ? I'm actually updating my notes, not just .bash_history :)
<_florent_>
somlo: no, that's only for the targets
<somlo>
ok, thanks!
<_florent_>
./target.py now generate the software generated files, compile the BIOS and generate the gateware files
<_florent_>
--build build the bitstream
<_florent_>
--load load the bistream
<somlo>
oh, so if I had tried to dig around the build folder, I would have found the verilog file there :)
<somlo>
it's just running the toolchain that's now an explicit command-line flag
<somlo>
got it!
<_florent_>
i did that for project external to LiteX and found that more convenient
<zyp>
nice, I like that change
<_florent_>
this way, if you just want to work on software, you just generate the files but don't build the gateware
<_florent_>
and if you want to load bitstream to the FPGA, you no longer need external script
<somlo>
I have to try openocd on nexys4ddr -- so far I've been loading the .bit file to the sdcard, and had the nexys set up to load it from there
<somlo>
but "tethered" mode via usb cable is much better for development
<daveshah>
I can recommend xc3sprog
<zyp>
I've been thinking it'd be nice to have some sort of change tracking as well, as in --load would rebuild the gateware only if it changed
<daveshah>
Despite the name it supports a lot of xc7 devices etc
<somlo>
zyp: that's something we should at least try to use `make` for, before rolling our own :D
<zyp>
somlo, well, I were thinking instead of reimplementing it from scratch, maybe we could reuse parts of scons
<tpb>
Title: ACCOLADE ANIC-40K QUAD PORT 10GBE 10GB PCI-E SFP+ ETHERNET, FULL PACKET CAPTURE | eBay (at www.ebay.com)
<john_k[m]>
ANIC-40Ku has a Kintex Ultrascale
<john_k[m]>
guessing maybe a Kintex? For $80 I grabbed one
<daveshah>
Looks like it was released in 2011, so Virtex-6 is a possibility too
<rw1nkler>
Hello Everyone! Please, could somebody provide me any tips about using the wishbone-tool with LiteX? Do I have to instanciate any special core, or simple serial is enough?
<zyp>
rw1nkler, you'll need an instance of UARTWishboneBridge if you wanna use it over serial