[libre-riscv-dev] Wish to work on

Luke Kenneth Casson Leighton lkcl at lkcl.net
Wed Mar 6 21:19:01 GMT 2019


On Wed, Mar 6, 2019 at 5:18 PM Rishabh Jain <rishucoding at gmail.com> wrote:
>
> Thanks for welcoming me :)

 :)

> I have read the charter and found it very sensible. I will obey the "Code
> of Honour".

 it's just... it feels totally different, doesn't it? a code of
"conduct" is an imposition: a demand for external restriction of
behaviour.  a code of "honour" is something that *you* take
responsibility for (and pride in).

> For installing yosys and nmigen:
> I have cloned the *yosys* repo from https://github.com/YosysHQ/yosys and
> ran make, make tests and sudo make install.
> And cloned the repo of *nmigen* and installed using " pip install git+
> https://github.com/m-labs/nmigen.git "
> These tools look interesting.

 yeah, they are.  yosys can actually be used to generate netlists for
ASIC layout, as well as for FPGAs.

> In the soc/TLB/src directory: I changed python3 to python3.6 in Makefile.
> After doing make, I got this console log : "python3.6 Cam.py generate -t v
> > Cam.v"

 ok great: now you have a Cam.v file, run yosys and do this:
 $ yosys
 yosys> read_verilog Cam.v
 yosys> show

 you *might* need to install xdot to get that to work properly
(apt-get install xdot)

> In my computer, python3 default is set to 3.5 version. I looked into
> modifying this:
> https://askubuntu.com/questions/900493/how-to-change-python3-from-python3-5-to-python3-6
> But, I fear my system will break. So, better I will manually call
> python3.6.

 ok you can "fix" that in any given window, like this:

 mkdir ~/socbin
 ln -s /usr/bin/python3.6 ~/socbin/python3
 export PATH=~/socbin:$PATH

 that last line, you can put into a file somewhere, which you can do
"source {filename}"

> Luke, can you give me an overview/brief on the 'soc' repository?

 well, it's really basic at the moment, and will expand later.
there's only really 2 main directories: TLB/src which contains the
modules that daniel's been working on, and TLB/test which contains the
unit tests.  you can experiment with them like this:

 $ cd TLB/test
 TLB/test$ mkdir Waveforms
 TLB/test$ python3 test_cam.py
 TLB/test$ gtkwave Waveforms/test_cam.vcd

(obviously, apt-get install gtkwave first)

then you can right-click on "top" on the right side, and
recurse-import all the signals.  then hit the "zoom fit" button and
you'll see all of the signals and when their values change, on
different clock cycles.

honestly it's pretty damn cool and it makes me wonder why the heck
it's not more commonly available as a standard python software
debugging tool!  being able to sequentially visualise *all* of the
variables of a program as it progresses line-by-line would be
extremely useful!

anyway if you left click anywhere on the main window you'll see a red
line, and then the values in the middle pane will change and you'll
see the values of all signals at that point.  you *may* need to scroll
the middle pane to see them.

basically that gets you "up and running" and confirms that all of the
debug and dev tools are operational.  hey do you still have cocotb
installed btw?

l.



More information about the libre-riscv-dev mailing list