Tuesday, 2019-08-20

*** tpb has joined #litex00:00
*** rohitksingh has quit IRC00:10
*** rohitksingh has joined #litex00:38
*** CarlFK has quit IRC01:04
*** rohitksingh has quit IRC01:13
*** CarlFK has joined #litex01:17
*** CarlFK has quit IRC01:28
*** CarlFK has joined #litex01:29
*** rohitksingh has joined #litex01:44
*** CarlFK has quit IRC01:49
*** CarlFK has joined #litex01:55
*** futarisIRCcloud has joined #litex03:35
*** rohitksingh has quit IRC05:13
*** rohitksingh has joined #litex05:36
*** rohitksingh has quit IRC05:50
futarisIRCcloudhttps://youtu.be/Ir_KBgbVr5807:34
_florent_mithro: thank, i was thinking about having a zephyr-on-litex-vexriscv repo in litex-hub similar to the linux one to show how to setup/use it.07:52
_florent_futarisIRCcloud: thanks for the link07:53
*** olofk has joined #litex09:46
olofkHi there09:47
olofkAnyone familiar with litesdcard? Looking for some hand-holding09:48
keesjHi there10:09
keesjolofk: I have a little (tested it somewhat)10:10
olofkkeesj: Cool. On which hw?10:10
keesjon the arty board with a self made adapter10:11
olofkah ok. That should be pretty similar to my Nexys A710:12
keesjlike this https://i.imgur.com/hlyKF3e.jpg10:13
olofkSo, the thing I want to do is to generate a stand-alone core that I can integrate into my SoC. (No, it's not a Litex-based SoC). Struggling a bit with Migen syntax.10:14
olofkNice board :)10:14
keesjyou core also uses migen or is it something else?10:15
olofklitesdcard is written in migen10:15
olofkRest of the SoC (except for a LiteDRAM instantiation) is verilog10:16
olofkSo as the first step I want to bring out the litesdcard stream ports to the top of the generated verilog. Think I got the sink port done and the source port should be similar, but I have no real idea about what else I need to expose10:17
keesjdo you implement a bus like wishbone?10:17
olofkFor configuration it will likely be axi or apb. For the stream ports I intend to do a stand-alone stream-to-axi converter. Got one for wb that I think I can modify (https://github.com/olofk/wb_streamer)10:19
tpbTitle: GitHub - olofk/wb_streamer: Wishbone component for converting data streams to wishbone transactions (at github.com)10:19
keesjI think that is the kind of interfacing you will need10:19
olofkWhat kinds of bus interface slave interfaces can I generate with litex? Only wishbone?10:20
keesjI don't know10:20
olofkI did a similar thing for litesata a couple of years ago and ended up just exposing the raw config regs and creating a bus adapter outside of the core10:21
olofkSo, that's one issue. Then I can't figure out how the CDC works. There's a SDClockerS7() instance created but I don't understand how it's connected to the litesdcard core10:23
*** futarisIRCcloud has quit IRC10:34
olofkAnother more general Litex question is about platform.request()10:38
olofkWhen I request the same resource twice, Python claims it doesn't exist anymore. Am I only supposed to request it once or is this a bug?10:38
olofkI also feel I lack a deep understanding of how the stream.Endpoint() class is supposed to be used10:57
keesjindeed the request is supposed to happen only once indeed10:57
olofkCool. That explains things10:59
keesj(and https://github.com/enjoy-digital/litesdcard/blob/master/test/test_sdcard.py ) is pretty nice in showing the code works without a cpu core (e.e. just using the uar wishbone bridge)11:00
tpbTitle: litesdcard/test_sdcard.py at master · enjoy-digital/litesdcard · GitHub (at github.com)11:00
keesjbut the code is full of "autoCSR" and other magic stuff that works well in the context of migen but I don't know how well it is suitable for generating something like a sdcard core that can be reused.11:02
olofkBut that code is just the part running on the PC side, right?11:03
keesjthe test_sdcard.py is yes11:03
olofkAnd the stuff in examples is the corresponding FPGA side?11:04
keesjbut not the core. e.g. https://github.com/enjoy-digital/litesdcard/blob/master/litesdcard/core.py#L2811:04
tpbTitle: litesdcard/core.py at master · enjoy-digital/litesdcard · GitHub (at github.com)11:04
olofkI'm trying to modify the arty exemple to be a bit more self-contained11:04
keesjyes ,pehrpas just call it with the correct arguments and see what the verilog looks like11:05
olofkThis is what I have come up with so far https://gist.github.com/olofk/f121e9c0acdae17bb3167d3d75f81a3111:09
tpbTitle: nexys.py · GitHub (at gist.github.com)11:09
olofkBut I have no idea why I get errors when I uncomment line 11711:09
olofkAFAIK that signal should be part of the Endpoint struct11:09
olofkHm.. payload.data works. Not sure I understand completely, but close enough :)11:13
keesjmy strategy (in learning migen/litex) is really grep -rsi11:15
keesje.g. finding examples11:16
olofkYeah, mine too11:16
olofkIn this case I picked it up from the verilog though :)11:17
olofkok, so now I need to figure out how to expose the CSRs and what the hell I should write to them to make it start11:21
olofkI presume exposing a wb/axi slave interface would be the best way forward but I have no idea how to proceed with that11:37
olofkAnyone wants to do a Migen/Litex tutorial at ORConf? :)11:37
olofkHaha. This one contained most of my issues :)  https://github.com/timvideos/litex-buildenv/wiki/Notes-and-Tips11:54
tpbTitle: Notes and Tips · timvideos/litex-buildenv Wiki · GitHub (at github.com)11:54
_florent_olofk: you can use platform.lookup_request to get a signal you already requested12:29
_florent_olofk: otherwise, for your SoC, i think what you want to do is remove the CPU from the example design12:29
_florent_then maybe the best is to disable the CPU in the example design(cpu_type=None), then expose the wishbone. This way you will still be able to access the CSR through the wishbone.12:31
_florent_SDClockerS7 i used to generate the SD clock and adapt frequency12:32
olofkHi _florent_: I think I got something now. I'm probably doing things in weird ways though, so happy to hear some comments12:35
olofkI put it here https://gist.github.com/olofk/f121e9c0acdae17bb3167d3d75f81a3112:35
tpbTitle: nexys.py · GitHub (at gist.github.com)12:35
olofkI presumed that SDClockerS7 was the adaptive clock, but I can't figure out how clock domains work. How do you assign logic to different domains?12:36
_florent_we use ClockDomainsRenamer to change the a clock of Module12:41
_florent_it should be used in LiteSDCard with the clock created by SDClockerS712:41
_florent_the possible issue i see with your core is that i don't think CSRs will be created collected since you are creating a Module and not a SoC. If you start from example, it will be the case. You also generate the csr map to .csv or .json (csr_csv or csr_json argument of Builder)12:48
olofkIn the generated verilog it looks like the CSRs get assigned to unique addresses12:49
olofkBut should I subclass BaseSoc instead?12:49
olofkSoCCore12:50
_florent_using module could work, but reusing SoCCore will probably be easier to start with, but if you see that CSR are connected and are able to get the addresses of registers, you can continue with your code12:54
_florent_sorry, i was just passing by, need to go12:54
olofkcool. I''ll test SoCCore at some point. Exporting the csrs would be nice12:54
olofkThanks. Take care12:55
olofkConsidering to package the sd emulator as a separate fusesoc core. Can anyone tell me a bit about the provenience of the code. Would be nice to have a single upstream repo instead of this trail of forks. Is it coming from scanlime's flipsyfat who in turn got it from ProjectVault? Did I miss any links?13:29
olofkLooks like the version in litesdcard is just a whitespace cleanup of flipsyfat13:34
olofkOh well. More work to be done tomorrow13:34
*** olofk has quit IRC13:39
keesjhmm working on a sd emulator?14:20
*** ambro718 has joined #litex15:50
mithro_florent_: I would like to get litex-buildenv into a shape that your happy to use it :-)16:06
_florent_mithro: to setup the environment, i really liked using lx-buildenv script from xobs  when testing fomu18:57
mithro_florent_: When you get a chance, can you review https://github.com/litex-hub/linux-on-litex-vexriscv/pull/39/files ?19:03
tpbTitle: soc_linux: adds support for I2CMaster by mateusz-holenko · Pull Request #39 · litex-hub/linux-on-litex-vexriscv · GitHub (at github.com)19:03
_florent_mithro: done and merged19:12
*** ambro718 has quit IRC20:54
*** futarisIRCcloud has joined #litex23:17

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