Monday, 2019-02-18

*** tpb has joined #timvideos00:00
*** puck_ has quit IRC01:00
*** Kripton has quit IRC01:58
*** Kripton has joined #timvideos02:16
*** futarisIRCcloud has joined #timvideos04:31
xobsDid something change with CSRs? I'm trying to use one in my design, and I'm getting an error that `'CSR' object has no attribute 'get_fragment_called'` which is true since it doesn't inherit from Module.05:15
*** rohitksingh_work has joined #timvideos05:28
CarlFKwhat's a CSR?05:29
CarlFKClient Service Rep :p05:29
xobsCarlFK: Configuration and Status Register05:29
CarlFKwhat crashed:
tpbTitle: Ubuntu Pastebin (at
CarlFKI launched  /home/juser/tv/litex-buildenv/./scripts/ and 100 things happen05:30
xobsOh, I guess maybe CSRs aren't actually submodules, so they shouldn't be added with `self.submodules = ...`05:37
mithroxobs: That is complicated05:38
mithroxobs: If they want to simulate properly they need to be submodules...05:39
xobsmithro: but if you want to synthesize at all, they need to not be submodules.05:39
mithroxobs: See the random fixes in my litex / migen branches -- I haven't had time to figure out if they are /right/ yet05:42
*** puck_ has joined #timvideos05:54
xobsmithro: Is that why tests give me the error "TypeError: do_finalize() missing 1 required positional argument: 'busword'"?06:02
mithroxobs: Yes - that means you don't have my patch06:03
*** puck_ has quit IRC06:03
xobsmithro: What's the long-term solution?06:09
mithroxobs: Figure out what the correct solution and get that upstream? :-P06:09
*** puck_ has joined #timvideos06:30
mithroxobs: I think the first thing is to chat to _florent_ and whitequark06:33
mithroI'm pretty sure I logged a bug somewhere...06:33
mithroI believe I was pretty clear in the commit messages somewhere...06:34
xobsmithro: does anyone else use simulation? This seems like the sort of thing that's either really broken, or we're doing it wrong.06:43
mithroxobs: Not for anything big06:43
xobsI also noticed that migen throws confusing depreciation warnings under python 3.7.06:45
xobsI'll talk to _florent_06:46
*** m4ssi has joined #timvideos08:02
_florent_xobs: hi, i can try to help, can you share your code? from what i understand if was working before but it's no longer the case?08:46
xobs_florent_: I'm working on simplifying the valentyusb stuff mithro did in order to demonstrate the problem. mithro mentions that CSRs aren't properly simulated unless they're instantiated as submodules.08:48
_florent_xobs: ok, i'm going to look at that08:56
xobs_florent_: Sorry I'm not able to give a more articulate answer -- I'm still trying to understand how it's all supposed to work.08:59
_florent_xobs: i don't think we need to declare CSR as submodules09:00
_florent_xobs: from the simulation, CSRs are just group of signals: re and storage for CSRStorage, re and status for a CSRStatus, etc...09:00
*** puck_ has quit IRC09:01
xobs_florent_: One problem I'm definitely having is that migen's fhdl says "TypeError: do_finalize() missing 1 required positional argument: 'busword'"09:01
_florent_xobs: can you give me a link of what you are testing? or the code?09:02
*** puck_ has joined #timvideos09:04
xobs_florent_: the most well-tested module is (the test driver is at with an example test at
tpbTitle: valentyusb/ at xobs-usb12 · xobs/valentyusb · GitHub (at
xobsIt's somewhat large and baroque, so I'm working on a smaller testcase.09:08
xobs_florent_: (you can remove the "import lxbuildenv" line)09:17
tpbTitle: Sample CSR failing simulation · GitHub (at
xobsmithro: can you give an example of how CSR simulation is wrong if you don't make it a submodule?09:20
*** futarisIRCcloud has quit IRC09:21
_florent_xobs: ok thanks09:21
_florent_xobs: is the issue happening only when write_from_dev is set to True?09:22
xobs_florent_: I get a variety of errors.  When I use a straight CSR, it gives the error "AttributeError: 'CSR' object has no attribute 'get_fragment_called'"09:25
tpbTitle: An example of CSRs failing with "AttributeError: CSR object has no attribute get_fragment_called" · GitHub (at
xobsIt does work if I don't put it under "self.submodules".  I wonder what issues mithro is seeing, then...09:30
_florent_i think mithro wants to be able to simulate the write_from_dev behaviour, and that's why the self.submodules is used09:51
xobs_florent_: I don't see csr values getting updated at all. Should this test program work?
tpbTitle: · GitHub (at
xobsWhen I run that, test_value.r doesn't ever get updated.10:07
_florent_xobs: in a SoC, the CSR are collected with the CSRBankArray Module and this one adds the CSR as submodules10:09
_florent_xobs: i'm don't think we should add the CSR to submodules manually10:10
mithroxobs: I have a test somewhere... Did you find my bug10:11
xobsmithro: ah, it's a pull request:
tpbTitle: WIP: Add test for CSRs and fix in simulation. by mithro · Pull Request #131 · enjoy-digital/litex · GitHub (at
mithroxobs: Look at that, past me even included an example / test10:13
xobsthanks, past mithro!10:13
mithroxobs: I think the question is why I needed two yields and why the csrs where being weird like this...10:14
xobsmithro: isn't it one cycle to get it into the buffer, and one to read it back out?  that doesn't surprise me.10:15
mithroxobs: It doesn't work that way10:16
mithroxobs: Any time the clock toggles and we is 1, it should update the CSR10:16
mithroyield should equal one clock toggle...10:16
xobsSo yield changes the clock twice? Once for negedge, and once for posedge?10:18
mithroxobs: As far as I understand10:19
xobsmithro: I wonder if that means we can't do DDR for spi flash.10:23
mithroFor spiflash you shouldn't be using the system clock10:24
xobsAnyway, it's nice to know that you're supposed to use accessors for reading and writing csr values, and not accessing the values directly.10:24
xobs_florent_: mithro what's the status of that PR? Or rather, how should I reliably simulate CSRs?10:45
mithroxobs: I can't recall...10:46
rohitksingh_workmithro: Hi! :) Mike "hamster" was asking about "Do you know a Verilog guru who can point out all my stylistic flaws in my Veriog? I am sure it is not using the Verilog idioms and could be improved or made more concise. " Whom do you recommend I point him to? Clifford? OlofK? Whitequark?11:13
mithrorohitksingh_work: Clifford maybe?11:51
mithrorohitksingh_work: olofk is more of an ASIC person...11:51
rohitksingh_workmithro: ok, thanks!12:05
*** rohitksingh_work has quit IRC13:03
*** sc00bz1 has joined #timvideos14:00
*** sc00bz has quit IRC14:01
*** sc00bz1 has left #timvideos14:02
CarlFKmithro: qemu-system-or1k ...  build/arty_net_or1k//software/bios/bios.bin14:05
*** sc00bz has joined #timvideos14:05
CarlFKmithro: 39../sysdeps/unix/sysv/linux/ppoll.c: No such file or directory.14:05
CarlFKmithro: works on bionic, errors ^^ on cosmic14:05
CarlFKmithro: where should I report this?14:06
*** rohitksingh has joined #timvideos14:12
*** TheAssassin has quit IRC14:37
*** TheAssassin has joined #timvideos14:40
CarlFKmithro: ignore ppoll.c: No such file14:50
CarlFKmithro: #qemu  pm215: "Unhandled exception 6" is a problem within the guest -- the guest code has reported that it took an unexpected error14:50
CarlFK  H2U 00:00:00>  *** Unhandled exception 6 ***14:50
tpbTitle: Ubuntu Pastebin (at
*** Kripton has quit IRC15:07
*** Kripton has joined #timvideos15:16
*** Kripton has quit IRC16:36
*** Kripton has joined #timvideos16:46
*** Kripton has quit IRC18:41
*** m4ssi has quit IRC18:46
*** Kripton has joined #timvideos18:46
*** rohitksingh has quit IRC19:53
*** puck_ has quit IRC20:29
*** puck_ has joined #timvideos20:30
*** pzieba[m] has quit IRC20:42

Generated by 2.13.1 by Marius Gedminas - find it at!