[libre-riscv-dev] pinmux in nmigen
Rishabh Jain
rishucoding at gmail.com
Fri Apr 26 11:30:23 BST 2019
hi luke,
i am having difficulty in understanding nmigen Record (hdl/rec.py)
i am able to follow some part of hdl/rec.py like Direction, fields,
__init__ in class Layout checking
for valid field, are the elements of field valid, avoiding duplication of
names.
but, i am not able to understand the full picture :(
can you give me some pointers over what is layout, shape?
from our diagram of GPIO (https://libre-riscv.org/shakti/m_class/pinmux/)
the i/o pad is a PHYSICAL PIN of processor which connects it to
peripherals, memory, etc, right?
so, we mux (select one of many) inputs of processor coming to i/o pad from
various peripherals and mux outputs of
processor coming to i/o pad going to peripherals.
I am not able to relate FAN_OUT and FAN_IN with this diagram :(
thanks,
rishabh jain
On Thu, Apr 4, 2019 at 3:50 AM Luke Kenneth Casson Leighton <lkcl at lkcl.net>
wrote:
> On Wed, Apr 3, 2019 at 6:05 PM Rishabh Jain <rishucoding at gmail.com> wrote:
> >
> > Hello luke,
> >
> > I have started with migen. I found a good tutorial at
> > http://blog.lambdaconcept.com/doku.php?id=migen:tutorial
> > I am getting to like it :)
>
> oo that's a good tutorial example, i'll make a note of it here
> https://libre-riscv.org/3d_gpu/
>
> > Now, I have a better understanding of migen.
> > I found there are some good examples in migen and nmigen repo. I am going
> > to check them soon.
>
> yehyeh they're pretty good. now if you look again at daniel's work
> (and also back at the tutorial) you'll see how to set up a simulaton
> (a unit test), which is a key step.
>
> > I was wondering if there is any technical document on migen or nmigen
> > giving complete documentation about this library. are you aware of
> anything
> > here?
>
> *sigh* ok so one way is to run epydoc on the actual source code
> (remember that in the Makefile of the pinmux?) and that will give you
> something current, based on the docstrings. or, you can go here but
> bear in mind it's based on migen not nmigen:
> https://m-labs.hk/migen/manual/
>
> > I find migen similar to cocotb in the sense, we write the design logic in
> > high level abstract manner (FHDL).
>
> yehyeh
>
> > I remember, we were using myHdl?
>
> that's right.
>
> > So, may you give me some pointers on choosing nmigen over it?
>
> myhdl you are forced to conform to a strict subset of python. using
> classes is extremely awkward, and constructing complex data structures
> even more so.
>
> by contrast, in nmigen and migen, you get to use *python* features to
> construct the HDL.
>
> > I haven't checked pinmux yet, but for starting writing modules in nmigen,
> > may you share thoughts on where can I begin?
>
> well, try looking at two similar examples from migen and nmigen, then
> pick say that tutorial and do a conversion from migen to nmigen.
>
> first of course, have a unit test working and be familiar with the
> gtkwave output. you *should* be able to do it nearly line-by-line
> and still on each change have the unit test running, because there is
> a compatibility from migen to nmigen.
>
> just... do it :)
>
> btw when you get to the pinmux, have a look at nmigen Record
> (hdl/rec.py) - you'll find it *already has* the exact in/out
> capability we need!
>
> l.
>
> _______________________________________________
> libre-riscv-dev mailing list
> libre-riscv-dev at lists.libre-riscv.org
> http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev
>
More information about the libre-riscv-dev
mailing list