Monday, 2020-10-12

*** tpb has joined #litex00:00
*** KSmith86 has joined #litex00:28
*** KSmith has quit IRC00:30
*** KSmith has joined #litex00:54
Xesxen_Heya! I'm trying to build litex for the fomu, but I keep running into this when yosys is being run: ERROR: Module `\IFS1P3BX' referenced in module `\fomu_pvt' in cell `\IFS1P3BX_1' is not part of the design. This is with running "python -m litex_boards.targets.fomu --cpu-type=serv --build" after running "python ./litex_setup.py init install --user" in a clean directory. Does anyone know why? I'm running yosys Yosys 0.9+3619 / c403c984 (which is the latest01:07
Xesxen_commit on master currently)01:07
*** Xesxen_ is now known as Xesxen01:07
*** _whitelogger has quit IRC01:53
*** _whitelogger has joined #litex01:56
*** KSmith has quit IRC02:20
*** Degi_ has joined #litex02:21
*** Degi has quit IRC02:21
*** Degi_ is now known as Degi02:22
*** awordnot has quit IRC02:30
*** awordnot has joined #litex02:31
*** KSmith has joined #litex03:30
*** proteusguy has quit IRC06:11
_florent_Xesxen: hi, sorry, there is still a manual modification needed: https://github.com/litex-hub/litex-boards/blob/master/litex_boards/targets/fomu.py#L8507:01
tpbTitle: litex-boards/fomu.py at master · litex-hub/litex-boards · GitHub (at github.com)07:01
sajattack[m]are there any example programs communicating with the cle215+ over litepcie? At a very basic level. I saw the UART issue and that's about the level of complexity I think I could handle07:14
sajattack[m]the linux kernel driver is great, but I don't quite understand how to transfer data back and forth07:14
_florent_sajattack[m]: the easiest is probably with litex_server: https://github.com/enjoy-digital/litex/wiki/Use-Host-Bridge-to-control-debug-a-SoC#add-a-pcie-bridge-to-your-soc09:46
tpbTitle: Use Host Bridge to control debug a SoC · enjoy-digital/litex Wiki · GitHub (at github.com)09:46
_florent_at least to use the MMAP interface09:46
_florent_i should improve the examples, but this will already allow you to access the registers of the SoC from python scripts09:48
_florent_if you have a specific use-case on mind, i could try to give directions09:48
sajattack[m]I was thinking about a pcie sha1 accelerator interfacing with a rust program running on linux09:49
sajattack[m]python looks friendly but might slow things down a bit09:49
sajattack[m]correct me if I'm wrong, but I thought mmap was for mapping a file into memory. How do you do transfers back and forth with it?09:52
_florent_ok, the MMAP interface is use to access the main bus of the SoC, this can be used to do transfers, but it's indeed slow09:55
_florent_for your case, you use the DMAs with minimal modification to the examples09:55
_florent_for example, we create a DMA here: https://github.com/enjoy-digital/litepcie/blob/master/examples/kc705.py#L83-L8709:56
tpbTitle: litepcie/kc705.py at master · enjoy-digital/litepcie · GitHub (at github.com)09:56
_florent_this DMA will have a source for the data coming from the Host and sink for the data going to the Host09:56
_florent_on the software side09:57
sajattack[m]what does that look like on the linux/software side?09:58
_florent_with dma test, we are connecting the source to the sink internally and verifying that we can do a dma loopack in the FPGA: https://github.com/enjoy-digital/litepcie/blob/master/litepcie/software/user/litepcie_util.c#L30309:58
tpbTitle: litepcie/litepcie_util.c at master · enjoy-digital/litepcie · GitHub (at github.com)09:58
_florent_and if you just want to use the source/sink to receive/send data, you can use litepcie_test: https://github.com/enjoy-digital/litepcie/blob/master/litepcie/software/user/litepcie_test.c09:59
tpbTitle: litepcie/litepcie_test.c at master · enjoy-digital/litepcie · GitHub (at github.com)09:59
_florent_./litepcie_test -c 0 play file.bin will generate file.bin on the source interface in the FPGA09:59
_florent_./litepcie_test -c 0 record file.bin 1024 will save the first 1024 bytes of the sink stream in the FPGA to file.bin10:00
_florent_for more information on the streams: https://github.com/enjoy-digital/litex/wiki/Streams10:00
tpbTitle: Streams · enjoy-digital/litex Wiki · GitHub (at github.com)10:00
sajattack[m]yeah I was looking at that litepcie_test but didn't quite understand it10:03
sajattack[m]I thought it was for recording bus traffic and playing it back or something10:04
sajattack[m]but it looks like maybe I can make my own program and just call litepcie_write and litepcie_read to do dma transfers?10:06
_florent_yes sure, litepcie_test is just an example to exercise the DMAs10:07
sajattack[m]it's not as simple as calling read and write on the file descriptor is it?10:15
sajattack[m]if you could, a simpler example of sending a string and retrieving a response from the fpga would be helpful for my understanding10:18
sajattack[m] * it's not as simple as calling linux open, read and write syscalls on /dev/litepcie0 or something is it?10:19
sajattack[m]my naive plan is10:24
sajattack[m]send string10:24
sajattack[m]retrieve sha1 of string10:24
sajattack[m]thinking of using this btw https://github.com/secworks/sha110:34
tpbTitle: GitHub - secworks/sha1: Verilog implementation of the SHA-1 cryptgraphic hash function (at github.com)10:34
_florent_sajattack[m]: it's almost as you are describing, but you still need to control the DMA. you could start by having a poll of strings you want to encode in strings.bin11:07
_florent_and do ./litepcie_test -c 0 play string.bin11:07
_florent_and in another terminal: ./litepcie_test -c record sha1.bin11:08
_florent_-c 011:08
sajattack[m]ok11:08
_florent_and in the FPGA integrate the sha1 module between the DMA source and sink11:09
sajattack[m]yeah11:09
_florent_DMA.source --> SHA1 --> DMA.sink11:09
_florent_and you'll just receive the encoded data in sha1.bin11:09
sajattack[m]thanks11:09
sajattack[m]I wonder, is there a better solution for streaming data in and out than files though? I'm sending quite a lot of strings so I guess I would need to create many files11:13
sajattack[m]it's workable but doesn't seem too elegant11:15
sajattack[m]I think it's on the order of 10TB of strings 😅11:19
_florent_sajattack[m]: yes sure, that's just a first example, you can customize litepcie_test for your need or use pipes11:58
*** KSmith has quit IRC12:03
st-gourichon-fidHi! We use the new CSRField feature here. In a design, when using registers holding several values, we typically need an "extract" function and an "inject" function.15:11
st-gourichon-fid"extract" takes a 32bit word and provides a plain value extracted at offset and size.15:12
st-gourichon-fid"inject" takes a 32bit word and modifies only the bit between offset (included) and offset+size (excluded) to reflect the value you want to inject.15:12
st-gourichon-fidSo far so good.  I'm pondering whether it is best to generate per-field dedicated extract() and inject() functions in csr.h, or if it is best to create a C-level macro that calls a generic extract() and a generic inject() with preprocessor magic to use the correct FIELDNAME_OFFSET and FIELDNAME_SIZE.15:14
st-gourichon-fidIn the first case I would provide a PR because I changes litex/soc/integration/export.py . I the second case I can just not share the extract and inject functions and macro.15:15
st-gourichon-fidAll of this is plain old C-close-to-hardware-level bit handling, just I see the opportunity for litex to provide some convenience... or not?15:16
st-gourichon-fidGenerating them all has the benefit of autocompletion in IDEs.15:30
*** kgugala has quit IRC17:44
*** kgugala has joined #litex17:49
*** kgugala_ has joined #litex18:10
*** kgugala has quit IRC18:14
*** KSmith has joined #litex18:36
*** xobs has quit IRC19:16
*** sajattack[m] has quit IRC19:16
*** disasm[m] has quit IRC19:16
*** CarlFK[m] has quit IRC19:16
*** leons has quit IRC19:16
*** abeljj[m] has quit IRC19:16
*** DerFetzer[m] has quit IRC19:16
*** xobs has joined #litex19:25
*** leons has joined #litex19:43
*** sajattack[m] has joined #litex19:43
*** disasm[m] has joined #litex19:43
*** CarlFK[m] has joined #litex19:43
*** DerFetzer[m] has joined #litex19:43
*** nrossi has joined #litex19:43
*** mibus[m] has joined #litex19:43
*** abeljj[m] has joined #litex19:43
sajattack[m]is a 512 bit CSR possible and/or a bad idea?20:05
*** indy has quit IRC20:26
*** alanvgreen has joined #litex20:26
*** alanvgreen has quit IRC20:28
*** alanvgreen has joined #litex20:29
*** indy has joined #litex20:31
sajattack[m]I get this error when trying to build the acorn_cle_215 target `python acorn_cle_215.py --build` `litex.build.generic_platform.ConstraintError: Resource not found: serial:None`21:51
*** lf has quit IRC23:50
*** lf has joined #litex23:51

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