_florent_ changed the topic of #litex to: LiteX FPGA SoC builder and Cores / Github : https://github.com/enjoy-digital, https://github.com/litex-hub / Logs: https://freenode.irclog.whitequark.org/litex
tpb has quit [Remote host closed the connection]
tpb has joined #litex
<tpb> Title: RISC-V Design & Verification with FPGA Hardware In The Loop (EU) (at resources.aldec.com)
jaseg has quit [Ping timeout: 240 seconds]
jaseg has joined #litex
Degi has quit [Ping timeout: 260 seconds]
Degi has joined #litex
kgugala_ has joined #litex
kgugala has quit [Ping timeout: 256 seconds]
CarlFK has quit [Ping timeout: 258 seconds]
peepsalot has quit [Remote host closed the connection]
peepsalot has joined #litex
TMM has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
TMM has joined #litex
<_florent_> Hi
<_florent_> dkozel: it's possible to use Chipscope on LiteX design, but you'll have to use the generated names in the verilog. On LiteX designs, it's generally easier to use LiteScope, but in some specific cases i'm also using Chipscope
<_florent_> somlo: nice for the litescard driver, are both reads and writes working?
kgugala_ has quit [Read error: Connection reset by peer]
kgugala has joined #litex
_franck_ has quit [Ping timeout: 272 seconds]
<acathla> What's the best way to build my own C code against a litex design? It builds a bios in build/software folder but Makefiles are somewhere else in litex.
<tpb> Title: icebreaker-litex-examples/c-riscv-blink at master · icebreaker-fpga/icebreaker-litex-examples · GitHub (at github.com)
<acathla> sajattack[m], so I just manually copy the files I need? Or make links.
<sajattack[m]> I'm not really sure how the code was generated, ask esden
<sajattack[m]> the makefile should work
<lkcl> _florent_: you may be interested to know, the creation of an ASIC-compatible "platform" is working well
<lkcl> https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/litex/florent/ls180soc.py;hb=HEAD#l29
<tpb> Title: git.libre-soc.org Git - soc.git/blob - src/soc/litex/florent/ls180soc.py (at git.libre-soc.org)
<lkcl> https://git.libre-soc.org/?p=soc.git;a=blob;f=src/soc/litex/florent/libresoc/ls180.py;hb=HEAD
<tpb> Title: git.libre-soc.org Git - soc.git/blob - src/soc/litex/florent/libresoc/ls180.py (at git.libre-soc.org)
<lkcl> the only major "pain" was (after taking ulx3s.py) to work out how to do "build", and i had to have a right-old dig into litex for a few hours and eventually worked it out
<lkcl> override GenericPlatform and cut/paste the verilog build code from LatticePlatform, that did the trick
<lkcl> ahh it is ok to add a 3rd bus (in this case a JTAG master) to periph_buses, right?
<lkcl> self.periph_buses = [ibus, dbus]
<lkcl> in this case
<lkcl> self.periph_buses = [ibus, dbus, wishbone_bus]
_whitelogger has joined #litex
<_florent_> lkcl: nice, what you are trying to do is very similar to the core generators except that you have to create your own ASICPlatform
<_florent_> you can maybe find inspiration in:
<tpb> Title: litepcie/gen.py at master · enjoy-digital/litepcie · GitHub (at github.com)
<lkcl> ah appreciatd
<tpb> Title: litedram/gen.py at master · enjoy-digital/litedram · GitHub (at github.com)
<tpb> Title: liteeth/gen.py at master · enjoy-digital/liteeth · GitHub (at github.com)
<_florent_> otherwise, for self.periph_buses, all the buses of the list will be connected yes
<lkcl> ahh goood
<_florent_> (and adapted in width and standard if necessary)
<lkcl> i was expecting that to work, i did however wonder if it would try to do something unexpected if there weren't 2 entries in the list
<lkcl> okaay. excellent
<_florent_> the SoC builder is logging these informations while building the SoC, so you can see which peripheral is added, if it's eventually adapted, etc...
<lkcl> as i'm adding JTAG - *real* JTAG (thanks to staf Chips4Makers for creating a full TAP FSM)
<lkcl> is there a way to connect those 4 pins to openocd in sim.py?
<_florent_> not yet no, but that could indeed be useful
<lkcl> i'd like to actually connect openocd to the simulation and e.g. single-step it, upload to memory and so on
<lkcl> the most logical / simplest route would be a network port
<_florent_> acathla: you can find a minimal firmware in https://github.com/litex-hub/fpga_101/tree/master/lab004
<tpb> Title: fpga_101/lab004 at master · litex-hub/fpga_101 · GitHub (at github.com)
<lkcl> hmmm although openocd can run as a server... http://openocd.org/doc/html/Server-Configuration.html
<tpb> Title: OpenOCD Users Guide: Server Configuration (at openocd.org)
<lkcl> hmmm
<lkcl> _florent_, if i have a suite of pins how do i get at the subpins
<lkcl> platform.request("jtag").request("tms")?
<lkcl> or platform.request("jtag.tms")?
<_florent_> jtagpads = platform.request("jtag")
<_florent_> then jtagpads.tms
<lkcl> ahh excellent thank you
<lkcl> self.comb += self.cpu.jtag_tdi.eq(jtagpads.tdi)
<lkcl> self.comb += jtagpads.tdo.eq(self.cpu.jtag_tdo)
<lkcl> that look reasonable?
<lkcl> seems to be DoingTheRightThing(tm) in the resultant verilog (hurrah)
<lkcl> how the hell am i going to test this?? :)
<lkcl> like... ok maybe i could write a migen JTAG FSM
<lkcl> however there must be a way to "chain" the JTAG internally to a Versa ECP5 JTAG port
<daveshah> There is the JTAGG primitive that lets you access the fabric from the JTAG port using some custom instructions
<daveshah> Its not documented but a few people have used it successfully in the past
<lkcl> daveshah: ah! did they happen to put some code somewhere in a public repository, do you know?
<daveshah> Yeah, just trying to find it
<tpb> Title: ulx3s-misc/top_jtagg_slave.v at 27338b0081b3b441f2fa77769350fa777bd3bcf9 · emard/ulx3s-misc · GitHub (at github.com)
<lkcl> staaar, whew. i wonder if it's similar to Xilinx BSCANE2 or something?
<lkcl> ah ha!
<tpb> Title: hadbadge2019_fpgasoc/top_fpga.v at 4ae8277c45e17e316bb4d46ce625c1507506cd36 · Spritetm/hadbadge2019_fpgasoc · GitHub (at github.com)
<lkcl> okaay. so "not quite actual jtag" but "more like how Xilinx BSCANE2 works"
<lkcl> still, thank you - it's something i could use to run on the ECP5.
<lkcl> haha of course i could just shove a USB JTAG adapter onto 4 spare pins.... :)
<daveshah> I've done that in the past tbh
<somlo> _florent_: writes work too; but there's something weird going on, like some sort of intensive internal polling -- the "computer" becomes really slow and unresponsive once the litex_mmc driver successfully finds and intializes the card
<somlo> but I'm still happy -- fixing something that already kinda works is better than a brick doing *nothing* :)
<somlo> also, back when I used spi-mode sdcard, the kernel was polling for the presence of the card, and could tell when it was inserted/ejected -- that's not (yet) working with litesdcard, and might have something to do with the slowness
<tpb> Title: opentitan/hw/dv/dpi/jtagdpi at master · lowRISC/opentitan · GitHub (at github.com)
<lkcl> aw fer goodness sake
<tpb> Title: litex/litex/build/sim/core/modules/jtagremote at master · enjoy-digital/litex · GitHub (at github.com)
<lkcl> lol
<lkcl> _florent_: that's exactly what i need :)
* lkcl facepalm
<lkcl> this will be hilarious if it works.
<lkcl> how is "configurations" specified for litex modules?
<lkcl> ext_module_s ext_mod
<lkcl> there must be some sort of config file created which contains "serial2tcp" config data (the port number)
<lkcl> and so on
<lkcl> ahh JSON files :)
<lkcl> SimConfig
<lkcl> SimConfig.add_module() - "args" i assume. so can set port=9999 (or whatever is needed for openocd)
<somlo> lkcl: just out of curiosity, are you doing a latex asic with the google skywater pdk thing, or is this something unrelated?
<somlo> s/latex/litex/ :D
<somlo> muscle memory is still a thing, apparently, after all these years :)
<lkcl> somlo, :) i have workds where i do that
* lkcl just accidentally did it lol
<lkcl> alliance / coriolis2.
<lkcl> with help and collaboration of Staf Verhaegen, from Chips4Makers
<lkcl> he is handling the NDAs with https://europractice-ic.com/
<tpb> Title: EUROPRACTICE | IC Service (at europractice-ic.com)
<somlo> lkcl: cool, thanks
<somlo> chip fabrication is a thing I know nothing about, but feel an obligation to learn about
<lkcl> yeah, very! with NLnet sponsorship paying for the MPW we can "experiment" and learn without having to pay EUR 18,000
<somlo> my uni has a 4-5 semester course sequence in the ECE dept (free to staff/employees who can convince the prof to let them enroll)
<lkcl> somlo: yes. things are definitely stepping up a gear
<lkcl> nice!
<somlo> but then covid happened, and I don't feel like taking in-person classes for another while :)
<lkcl> somlo: get plenty of morning sunlight, and when you can't, get some pharmaceutical-grade 50,000 AU Vitamin D
<lkcl> and if you do get it for god's sake order and absolutely insist to the people that are looking after you to provide you with micro-aerosolised doses of the steroids used for treating asthma.
<lkcl> getting there
<lkcl> build/sim/core/sim.c Could not find interface jtag with index 0
<lkcl> now i have to call... platform.extensions... something?
<lkcl> i've seen this somewhere in spi_sdcard
<lkcl> dang!
<lkcl> that worked. had to remember to actually request the jtag platform and connect up the pins just like for the LS180 ASIC
<lkcl> holy s***! Info : JTAG tap: auto0.tap tap/device found: 0x000018ff (mfg: 0x47f (<invalid>), part: 0x0001, ver: 0x0)
<lkcl> that's just stunning.
CarlFK has joined #litex
<st-gourichon-fid> Hi all, including _florent_ . We are concerned about building software without manually copying csr.h and the like. We are aware about linker.ld and cousins.
<st-gourichon-fid> We now have a working design with SERV, can run lxterm. From your link https://github.com/litex-hub/fpga_101/blob/master/lab004/firmware/Makefile we can compile the software.
<tpb> Title: fpga_101/Makefile at master · litex-hub/fpga_101 · GitHub (at github.com)
<st-gourichon-fid> Generated files for a design include output_format.ld and regions.ld which is good. We are comparing the various existing linker.ld to figure out.
<st-gourichon-fid> TL;DR: Is https://github.com/litex-hub/fpga_101/blob/master/lab004/firmware/linker.ld suitable to compile on "any" design based on your gist https://gist.github.com/enjoy-digital/82ed88b77ef0b1e3e91b0592e44eaa14 or are there caveat?
<tpb> Title: fpga_101/linker.ld at master · litex-hub/fpga_101 · GitHub (at github.com)
<st-gourichon-fid> Mmh, code does not compile because irq_setie not defined. Is it normal that https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/cpu/serv/irq.h is empty?
<tpb> Title: litex/irq.h at master · enjoy-digital/litex · GitHub (at github.com)
kgugala has quit [Ping timeout: 256 seconds]
kgugala has joined #litex
_franck_ has joined #litex
<esden> acathla: sajattack[m] the code for the C example is generated by litex. These are the same headers as the ones used for the bios. I just copy them out from the litex build directory. I thought I described it in one of the README files... You will need to copy the headers out of litex every time you change anything regarding CSRs.
<esden> rust example is much more clever, it uses the generated svd, and on the fly generates the necessary glue definitions for you.
st-gourichon-fid has quit [Ping timeout: 246 seconds]
st-gourichon-fid has joined #litex
<sajattack[m]> yeah I'm more familiar with how the rust side works
st-gourichon-fid has quit [Quit: ZNC - https://znc.in]
st-gourichon-fid has joined #litex
st-gourichon-fid has quit [Client Quit]
st-gourichon-fid has joined #litex
st-gourichon-fid has quit [Quit: ZNC - https://znc.in]
st-gourichon-fid has joined #litex
esden has quit [Read error: Connection reset by peer]
daveshah has quit [Read error: Connection reset by peer]
daveshah has joined #litex
futarisIRCcloud has quit [Read error: Connection reset by peer]
esden has joined #litex
futarisIRCcloud has joined #litex
CarlFK has quit [Ping timeout: 272 seconds]
lf_ has quit [Ping timeout: 260 seconds]
lf has joined #litex