Tuesday, 2019-10-08

*** tpb has joined #litex00:00
*** keesj has quit IRC00:14
*** keesj has joined #litex00:15
*** CarlFK has joined #litex00:30
*** CarlFK has quit IRC03:14
*** CarlFK has joined #litex03:17
*** freeemint has quit IRC03:57
*** tpb has joined #litex04:21
*** CarlFK has quit IRC05:21
*** freeemint has joined #litex10:29
*** freeemint has quit IRC12:31
*** freeemint has joined #litex13:01
*** spacekookie has quit IRC13:05
*** spacekookie has joined #litex13:06
*** CarlFK has joined #litex13:41
*** CarlFK has quit IRC15:27
scanakciI am having a lot of errors when trying to use litex_sim for blackparrot. Currently, I am writing the cpu wrapper for BlackParrot. While using add_sources in the core.py, I can see that verilator is confused in terms of module, package hierarchy. In the log file (starting from line 16), you can see the errors. The first error is "syntax error, unexpected IDENTIFIER, expecting PACKAGE-IDENTIFIER" import bp_common_pkg::*;15:27
scanakciGoogle tells me that the order of files is important for system verilog. I see these two links which makes me think that a specific file should be provided to Verilator to prevent the confusion.15:28
scanakcihttps://www.veripool.org/boards/18/topics/1223-Verilog-Perl-ERROR-on-importing-a-pkg15:28
tpbTitle: ERROR on importing a pkg - Verilog-Perl - Veripool (at www.veripool.org)15:28
scanakcihttps://www.veripool.org/boards/2/topics/1656-Verilator-Parse-error-with-import-name-15:28
tpbTitle: Parse error with import name::* - Verilator - Veripool (at www.veripool.org)15:28
scanakciIs there any way to tell litex_sim the order of files? There is -f flag in Verilator that may be useful I guess. I do not have any experience with Verilator, recently learning.15:31
scanakciLog from litex_sim.py https://usercontent.irccloud-cdn.com/file/L6WRt7yr/log15:32
scanakciThis is how my add_source look like: https://usercontent.irccloud-cdn.com/file/01YdC4ML/addsource15:33
scanakciI also looked at other cpus. In general, they have one or two verilog files. I guess similar problems did not happen for those cpus.15:34
xobsapropos of nothing (thanks, Dolu!), to flush the data caches in vexriscv the command is `.word 0x500F`.  This will come in handy when writing to XIP flash using the CSRs.15:37
_florent_scanakci: i haven't used Verilator/litexsim a lot with system-verilog files, i think the way to get it to work to first execute litexsim, then modify the generated files manually to get it working and accepted with verilator and when working/understood, apply this changes back to litexsim16:51
_florent_scanakci: do you already have some verilator testbenchs for you CPU?16:52
scanakciBlackParrot repo has verilator testbenchs16:52
scanakciThey have bunch of makefiles to run their testbenchs using verilator, which I could run without any problem16:53
scanakciI can see that they are generating a verilatorlist.file which includes paths to the system verilog files used by verilator16:54
scanakciI guess I need to modify litex_sim to accept that kind of file16:54
scanakcias you already pointed16:54
_florent_scanakci: if you give me the manually modified litex_sim generated files that works with BlackParrot, i'm happy to do the integration in LiteX17:04
*** CarlFK has joined #litex17:05
somlo_florent_: I was going to send a PR containing this patch: https://pastebin.com/BmKrLmeh (get_csr_header should use the existing SoC shadow base, right now both soc_core and https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/export.py#L159 independently assume their own default 0x8000_0000)17:44
tpbTitle: litex/export.py at master · enjoy-digital/litex · GitHub (at github.com)17:44
somloand then I noticed "with_shadow_base=True", only in get_csr_header. It's only used here: https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/export.py#L17717:45
tpbTitle: litex/export.py at master · enjoy-digital/litex · GitHub (at github.com)17:45
somloand I'm wondering if it's useful at all, or mostly just dead code. I'm thinking of also removing the "with_shadow_base" check, and we can simply set shadow_base to 0 if we don't want it, which should be an orthogonal, future conversation :)17:46
somloany thoughts?17:46
* somlo will be back in 30 minutes, sorry to ask a question and immediately go afk :(17:48
scanakci_florent_: To clarify, do you want me to modify the auto-generated files by litex_sim ( some files in gateware and software folders) and make sure those work with blackparrot?17:53
somlo_florent_: https://github.com/enjoy-digital/litex/pull/274 (I'm fairly confident this one's right)18:32
somlowould still be curious in understanding what role 'with_shadow_base' is supposed to play here: https://github.com/enjoy-digital/litex/blob/master/litex/soc/integration/export.py#L17718:34
tpbTitle: litex/export.py at master · enjoy-digital/litex · GitHub (at github.com)18:34
scanakciIn gateware file, I am modifying the build_dut.sh and running it. Looks like that if I change the order of files (first header files) in verilator command, the errors vanish.18:47
scanakci__florent_: Does that work for you if I modify build_dut.sh file to read paths or files from a file (verilator looks like to have this capability)? I can then provide modified file to you.18:49
*** freeemint has quit IRC19:00
_florent_scanakci: yes, that's what i was suggesting, if you provide me the modified .sh that works, i'll do the modification in litex_sim to make it work (please also provide the skeleton of the blackparrot wrapper you have so that i can test)19:01
_florent_scanakci: if you want, you can create a litex issue for that on github19:01
*** freeemint has joined #litex19:02
scanakci_florent_: thank you so much. I will create the issue. Sure, I can provide the wrapper. It will fail at this point since blackparrot does not have an AXI interface. We are working on it in parallel.19:05
_florent_scanakci: yes sure no problem, that's just to work on the litex_sim issue19:10
*** Dolu has quit IRC19:12
_florent_somlo: thanks, i'll look where with_shadow_base is used19:14
*** [tj] has left #litex19:15
*** freeemint has quit IRC19:17
*** freeemint has joined #litex19:18
*** CarlFK has quit IRC21:40
*** snajpa has joined #litex21:41
snajpaERROR: Multiple edge sensitive events found for this signal!21:41
snajpavery noob question: how does one debug that? :)21:41
snajpahttps://paste.vpsfree.cz/V8_kgujf/21:42
tpbTitle: V8_kgujf , Diff | HaveSnippet (at paste.vpsfree.cz)21:42
snajpahere's what I'm trying to do (on top of https://github.com/enjoy-digital/versa_ecp5/)21:43
tpbTitle: GitHub - enjoy-digital/versa_ecp5: Versa ECP5 SoC based on LiteX (at github.com)21:43
*** CarlFK has joined #litex21:44
daveshahsnajpa: if you have a look at the full Yosys output (ie the log file) you should see a more useful message21:44
snajpaok, that's how the emulator PHY is done - it needs to do stuff on both edges of sd_clk21:52
snajpait that not supported by yosys yet?21:52
daveshahIt's not synthesisable Verilog at all21:53
snajpaok, "the more you don't know you don't know"21:54
snajpa:D21:54
daveshahand although there are some DDR IO hardware primitives they can't implement arbitrary logic like this21:54
daveshahCan you point me to the problematic line?21:54
snajpaso the SD emulator core in LiteSDCard is for simulation only?21:54
snajpasec21:54
snajpahttps://github.com/enjoy-digital/litesdcard/blob/master/litesdcard/emulator/verilog/sd_phy.v21:55
tpbTitle: litesdcard/sd_phy.v at master · enjoy-digital/litesdcard · GitHub (at github.com)21:55
snajpaand yosys says:21:55
snajpaCreating register for signal `\sd_phy.\spi_cnt' using process `\sd_phy.$proc$/home/snajpa/fpga/litesdcard/litesdcard/emulator/verilog/sd_phy.v:194$5604'.21:55
snajpaERROR: Multiple edge sensitive events found for this signal!21:55
snajpaspi_cnt is used in both posedge and negedge handling of sd_clk21:56
daveshahLooks like it is supposed to be synthesisable21:56
daveshahNo, it isn't21:56
daveshahJust the asynchronous reset is written in an illegal way21:56
daveshahI think splitting https://github.com/enjoy-digital/litesdcard/blob/master/litesdcard/emulator/verilog/sd_phy.v#L196 into an if and an else if should fix it21:57
tpbTitle: litesdcard/sd_phy.v at master · enjoy-digital/litesdcard · GitHub (at github.com)21:57
daveshahEach asynchronous reset in the always list has to correspond to an if/else if condition21:57
snajpadaveshah: but that won't help with spi_cnt being written to @ posedge *and* negedge of sd_clk, will it?22:13
daveshahBecause it isn't22:14
daveshahIt's simply a signal with two asynchronous resets22:14
daveshahYou could even factor the "or" out, create a new signal and then have a traditional async reset22:15
*** forksand has joined #litex22:32
*** Dolu has joined #litex22:43
snajpaokay this is awesome :)23:17
* snajpa excited as hell23:17

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