im-tomu / fomu-workshop

Support files for participating in a Fomu workshop
https://workshop.fomu.im
Apache License 2.0
162 stars 64 forks source link

Misunderstanding on Migen and LiteX page #98

Open brnbrnrd opened 4 years ago

brnbrnrd commented 4 years ago

This issue concerns the Migen/LiteX page of thu tutorial.

It was not clear where I had to copy paste the extra Python code for adding the fomu_rgb csr_register.

In particular I copy pasted these instructions

    # Add the LED driver block
    led_pads = soc.platform.request("rgb_led")
    soc.submodules.fomu_rgb = FomuRGB(led_pads)

at the end.

Nothing happened because it is after the building is done.

  1. Instructions could be clearer on where to copy-paste the code (also true for the class FomuRGB).
  2. A warning should tell that I tried to modify registers after they were built.
mainini commented 4 years ago

IMHO #110 closes this...

xobs commented 4 years ago

What do you think, @brnbrnrd ?

mithro commented 4 years ago

I don't think #110 fixes this. It still isn't clear that the code should be added before the builder and there is no error if you try to add something after the build has been done.

aerohoff commented 4 years ago

Yeah, I was able to figure out what to do. But I think it would be helpful to say where to paste the class (after the imports, before main) and where to put the other lines (in main, after the soc = BaseSoC... line), then rebuild and re-dfu. Or maybe there could be comments in the python file saying where they go.