*** tpb has joined #litex | 00:00 | |
xobs | acathla: only if you want to contribute! Or make changes to it. There are precompiled binaries in the `releases` section. | 00:39 |
---|---|---|
*** rohitksingh has quit IRC | 01:34 | |
*** CarlFK has quit IRC | 01:40 | |
*** rohitksingh has joined #litex | 02:06 | |
*** litex-questions has joined #litex | 03:52 | |
litex-questions | Hi, I have what I think are two quick CSR related questions.Is there a way to add CSR | 03:53 |
litex-questions | 1. Is there a way to add a CSR from the top-level module? | 03:53 |
litex-questions | 2. Is there a way to add CSRs from grandchildren of the top-level module? | 03:54 |
litex-questions | to be more precise, is there a way to add CSRStatus register for the top-level module (say the SoC). And for the second question, is there a way to add_csr from a submodule's submodule. | 03:56 |
*** CarlFK has joined #litex | 03:56 | |
*** rohitksingh has quit IRC | 04:45 | |
*** rohitksingh has joined #litex | 04:46 | |
*** oter has joined #litex | 06:10 | |
*** oter has quit IRC | 06:15 | |
_florent_ | Hi litex-questions, for 1)currently, it's not possible to have the CSR directly in the top-level module, you can create a simple Module, AutoCSR in your top level, add it to the design: | 06:24 |
_florent_ | https://www.irccloud.com/pastebin/H37x3hvX/ | 06:24 |
tpb | Title: Snippet | IRCCloud (at www.irccloud.com) | 06:24 |
litex-questions | Thanks _florent_ | 06:26 |
_florent_ | For 2), it would be done like this: | 06:26 |
_florent_ | https://www.irccloud.com/pastebin/wBZAUEwK/ | 06:27 |
tpb | Title: Snippet | IRCCloud (at www.irccloud.com) | 06:27 |
_florent_ | but i would not recommend it since it will not be flexible since you need to know the name of the top_level module in the submodule | 06:28 |
litex-questions | Yea, I basically did the same for both the cases. Was wondering if there was an easier way | 06:28 |
litex-questions | If feels like chaining AutoCSRs is something that would be cool | 06:29 |
litex-questions | and useful | 06:30 |
_florent_ | It's already the case, but not in the top-level | 06:30 |
_florent_ | add_csr is only required for the module directly instantiated in the top-level | 06:31 |
litex-questions | so you are saying, if a top-level's submodule's submodule has an AutoCSR then it automatically gets added, when I call add_csr in the top module just for the top-module's submodule? | 06:32 |
_florent_ | yes exactly | 06:32 |
litex-questions | And what if the top-level's submodule is NOT an AutoCSR? | 06:32 |
_florent_ | For the auto-chaining to work, all Modules if the chain needs to be an AutoCSR | 06:35 |
litex-questions | makes sense. Thanks _florent_ | 06:35 |
awygle | am i right that CSRs get converted into memory locations on whatever concrete bus the SoC ultimately uses? | 06:58 |
_florent_ | awygle: not sure it if answer the question, but the CSRs are collected and connected to a CSR Bus that is bridged/mapped to the main SoC bus | 07:13 |
awygle | interesting. can you say more about the "CSR Bus"? is that a custom litex bus protocol? | 07:13 |
_florent_ | That's a very simple bus, a bit similar to APB with limited control signals where reads/writes are expected to be done in 1 cycle. This has been introduced in Milkymist, then reused in MiSoC. The CSR bus in LiteX reusing the CSR Bus from MiSoC, we just made it more generic (to support various data width), added some controls signals (to know when the register is accessed in read) + CSR Fields to ease defining the | 07:21 |
_florent_ | mapping of the registers, describe it and allow automatic documentation. | 07:21 |
awygle | i see | 07:26 |
awygle | thank you for the information | 07:26 |
*** m4ssi has joined #litex | 07:46 | |
*** CarlFK has quit IRC | 08:39 | |
*** m4ssi has quit IRC | 08:43 | |
*** m4ssi has joined #litex | 08:45 | |
*** massi_ has joined #litex | 08:50 | |
*** m4ssi has quit IRC | 08:50 | |
*** massi_ has quit IRC | 08:54 | |
*** m4ssi has joined #litex | 08:54 | |
*** m4ssi has quit IRC | 08:58 | |
*** m4ssi has joined #litex | 08:58 | |
*** rohitksingh has quit IRC | 10:04 | |
*** _whitelogger has quit IRC | 10:16 | |
*** _whitelogger has joined #litex | 10:19 | |
*** _whitelogger has quit IRC | 16:14 | |
*** _whitelogger has joined #litex | 16:19 | |
*** m4ssi has quit IRC | 17:20 | |
*** rohitksingh has joined #litex | 19:14 | |
sajattack[m] | I've asked about ps/2 keyboard suggestions a couple times and haven't got any feedback, anyone have ideas on how best to go about implementing something like that? | 19:52 |
sajattack[m] | my thoughts so far are to share the uart bus but I don't really know how practical that is | 19:53 |
sajattack[m] | for a half-decent mister core I need video, sdcard and keyboard. I got video, sdcard is in progress it sounds like, and now I gotta figure out keyboard | 20:02 |
*** CarlFK has joined #litex | 20:26 | |
_florent_ | sajattack[m]: you could reuse a PS2 core and connect it to the UART RX | 20:28 |
_florent_ | it seems there was a PS2 core in Milkymist: https://github.com/tmatsuya/milkymist-ml401/blob/master/cores/ps2/rtl/ps2.v | 20:28 |
tpb | Title: milkymist-ml401/ps2.v at master · tmatsuya/milkymist-ml401 · GitHub (at github.com) | 20:28 |
sajattack[m] | ok cool | 20:30 |
john_k[m] | sajattack: are you writing a mister core in litex? | 20:32 |
sajattack[m] | I'm trying to get linux-on-litex running on mister | 20:32 |
john_k[m] | Ahh cool | 20:32 |
_florent_ | You could create a wrapper around a PS2 core and add a source as a stream.Endpoint (valid/ready/data) | 20:32 |
_florent_ | this way, it will be very easy to connect to the UART | 20:33 |
sajattack[m] | yeah that's kind of what I was thinking | 20:33 |
sajattack[m] | _florent_: there are many ps2 cores out there, any reason you pointed out that one? | 20:33 |
_florent_ | sajattack[m]: another PS2 core could probably be used, i just pointed this one since Milkymist's code is minimal and working well | 20:39 |
sajattack[m] | ok, and you suggest I wrap a verilog one, rather than write one in migen? | 20:41 |
_florent_ | sajattack[m]: you can write one in migen, that was just to use as a reference since i'm not aware of PS2 code in migen | 20:43 |
sajattack[m] | ok | 20:43 |
*** rohitksingh has quit IRC | 21:03 | |
sajattack[m] | I'm pretty new to migen but I'm gonna try | 21:13 |
sajattack[m] | first dumb question, is a signal more like a pin, wire, or reg? | 21:14 |
_florent_ | sajattack[m]: you can find useful information here: https://github.com/m-labs/migen/blob/master/migen/fhdl/structure.py#L305 | 21:19 |
tpb | Title: migen/structure.py at master · m-labs/migen · GitHub (at github.com) | 21:19 |
sajattack[m] | so it's like wire and reg combined, eh? | 21:21 |
_florent_ | yes | 21:21 |
sajattack[m] | what's closest to `input`? | 21:22 |
sajattack[m] | also signal? | 21:27 |
*** rohitksingh has joined #litex | 21:36 | |
*** rohitksingh has quit IRC | 22:47 | |
*** _whitelogger has quit IRC | 23:43 | |
*** _whitelogger has joined #litex | 23:46 |
Generated by irclog2html.py 2.13.1 by Marius Gedminas - find it at mg.pov.lt!