Bug 626 - dev-env-setup script for verilator, ghdl, iverilog and cocotb
Summary: dev-env-setup script for verilator, ghdl, iverilog and cocotb
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Documentation (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Veera
URL:
Depends on:
Blocks:
 
Reported: 2021-04-19 10:11 BST by Luke Kenneth Casson Leighton
Modified: 2021-09-19 01:55 BST (History)
1 user (show)

See Also:
NLnet milestone: NLNet.2019.10.043.Wishbone
total budget (EUR) for completion of task and all subtasks: 250
budget (EUR) for this task, excluding subtasks' budget: 250
parent task for budget allocation: 384
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:
veera={amount=250,paid=2021-08-21}


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2021-04-19 10:11:47 BST
an automated build including dependencies is needed for both
verilator, ghdl, iverilog and cocotb.  all of these are needed
from source.

specifically at the moment, verilator version v4.106 is needed.
use "git checkout v4.106" to do this, after cloning.
Comment 1 Veera 2021-05-19 22:18:11 BST
Built Verilator successfully.

Added Verilator dev-env-script.

uri: https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=verilator-install;h=c136a0f75993bf65746a79b9f2ab2f78d15b1f4c;hb=HEAD

Tell me about in which page to add in the Wiki.
Comment 2 Luke Kenneth Casson Leighton 2021-05-20 00:32:10 BST
(In reply to vklr@vkten.in from comment #1)
> Built Verilator successfully.
> 
> Added Verilator dev-env-script.

fantastic!

> Tell me about in which page to add in the Wiki.

HDL_workflow page, in its own (new) subsection.

even just "this is best installed with script <insert link>, we advise using only v4.106 at the moment"
Comment 3 Veera 2021-05-20 09:36:54 BST
Any payment can be had for this bug work and others to follow.
Comment 4 Luke Kenneth Casson Leighton 2021-05-20 13:46:30 BST
(In reply to vklr@vkten.in from comment #3)
> Any payment can be had for this bug work and others to follow.

yes of course.  it needs to be 100% completed, and the task is for
ghdl iverilog and cocotb as well.
Comment 5 Veera 2021-05-20 21:39:07 BST
Updated pages for Verilator.

uri: https://libre-soc.org/HDL_workflow/
uri: https://libre-soc.org/HDL_workflow/verilator/

Please review.
Comment 6 Veera 2021-05-20 21:50:19 BST
I checked cocotb installation page. It's written that install neccessary prerequisites and then do pip install. Is it okay to do pip install?
Comment 7 Veera 2021-05-22 11:12:55 BST
Built GHDL successfully.

Added Ghdl dev-env-script.

uri: https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=ghdl-install;h=3de01a18a3d91c1e68b05516c586d74f8a8fafd3;hb=HEAD

I have used GCC as backend.
See this url: https://ghdl.readthedocs.io/en/latest/getting/index.html

Please review.
Comment 8 Luke Kenneth Casson Leighton 2021-05-22 12:10:03 BST
(In reply to vklr@vkten.in from comment #7)
> Built GHDL successfully.
> 
> Added Ghdl dev-env-script.

brilliant

> 
> uri:
> https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=ghdl-install;
> h=3de01a18a3d91c1e68b05516c586d74f8a8fafd3;hb=HEAD
> 
> I have used GCC as backend.
> See this url: https://ghdl.readthedocs.io/en/latest/getting/index.html

urr!  that's horrible! i wasn't expecting that.  ok i'll build it and
check it, let you know.

thanks veera.

cocotb next, you'll need verilator and ghdl (they are dependencies)
Comment 9 Veera 2021-05-22 13:14:45 BST
Built Icarus Verilog successfully.

Added iverilog dev-env-script.

uri: https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=iverilog-install;h=0da8e4ab12c9c9bf1f159e6f56f7c9bf8a3baf7a;hb=HEAD

Please review.
Comment 10 Veera 2021-05-22 13:18:14 BST
(In reply to Luke Kenneth Casson Leighton from comment #8)
> (In reply to vklr@vkten.in from comment #7)
> > Built GHDL successfully.
> > 
> > Added Ghdl dev-env-script.
> 
> > 
> > I have used GCC as backend.
> > See this url: https://ghdl.readthedocs.io/en/latest/getting/index.html
> 
> urr!  that's horrible! i wasn't expecting that.  ok i'll build it and
> check it, let you know.
> 

What's horrible: can you explain the particular thing.
Want me to try mcode or llvm one.
Comment 11 Luke Kenneth Casson Leighton 2021-05-22 18:13:24 BST
(In reply to vklr@vkten.in from comment #10)

> What's horrible: can you explain the particular thing.

the fact that you have to use another
compiler like that. quite fascinating.

> Want me to try mcode or llvm one.

nooo :)


cocotb should in theory be straightforward

https://docs.cocotb.org/en/stable/install.html

get the list of dependencies from there, from the debian tab.

git clone

then "python3 setup.py install"

this should be enough.
Comment 12 Veera 2021-05-22 20:13:51 BST
Built Cocotb successfully.

Added cocotb dev-env-script.

uri: https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=cocotb-install;h=4a34adbd1527a11ba2e8bbe25d84d34ad79e2777;hb=HEAD

It's using python3 pip. This is the recommended way as per official install page.
pip3 uses git to clone the repository and install. And it installs cocotb-bus
dependency as well. We can specify the git tag or revision to pip3 for specific
installation.

cocotb-config --help and --version works. I have not run real simulation though,
as I do not know how to do it. Can you check it. Or give me hints for how to do
it.

Please review.
Comment 13 Luke Kenneth Casson Leighton 2021-05-22 20:42:43 BST
(In reply to vklr@vkten.in from comment #12)
> Built Cocotb successfully.
> 
> Added cocotb dev-env-script.
> 
> uri:
> https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=cocotb-install;
> h=4a34adbd1527a11ba2e8bbe25d84d34ad79e2777;hb=HEAD
> 
> It's using python3 pip.

i know.  it's a damn nuisance.  we don't need the hassle.

please do "git pull".

also, the compile needs to be in $SUDO_USER/src like the other
scripts, i added a TODO note for you.


>  This is the recommended way as per official install
> page.

the "official" way can take a hike :)

> pip3 uses git to clone the repository and install. And it installs cocotb-bus
> dependency as well.

yes.  usually in a way that is also a damn nuisance, pulling in arbitrary
untrusted untrustable dependencies that you have absolutely no control
over, in a non-repeatable fashion.

been here dozens of times.

>  We can specify the git tag or revision to pip3 for
> specific
> installation.
> 
> cocotb-config --help and --version works. I have not run real simulation
> though,
> as I do not know how to do it. Can you check it. Or give me hints for how to
> do
> it.

$ cd tests
$ make

it will be necessary to add "apt-get install python3-pytests" to the
list of dependencies.

the developers have failed to add that to the list of dependencies
in setup.py.  there's a way you're supposed to do that, for testing
(python3 setup.py test) so you receive a notice.

add python3-pytests to the list of build dependencies.
Comment 14 Veera 2021-05-23 15:43:30 BST
Updated the cocotb-install script.

uri: https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=cocotb-install;h=67c7a572aca88c1448958e50c43bbeee46e5f0b7;hb=HEAD

Please review.
Comment 15 Luke Kenneth Casson Leighton 2021-05-23 15:54:50 BST
(In reply to vklr@vkten.in from comment #14)
> Updated the cocotb-install script.
> 
> uri:
> https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=cocotb-install;
> h=67c7a572aca88c1448958e50c43bbeee46e5f0b7;hb=HEAD
> 
> Please review.

ok that seems to work - i didn't mean "remove python3-pip" however
it does seem to work, including downloading cocotb_bus.
Comment 16 Veera 2021-05-23 16:00:06 BST
Updated ghdl-install script.

uri: https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=ghdl-install;h=adcd752d65e538552e151c1f116e500575383c25;hb=HEAD

Added --enable-default-pie option to gcc configure script. This option should
match system gcc setting. Otherwise during ghdl called linker stage error occurs
about non fpic and fpic code mismatch.
Comment 17 Veera 2021-05-23 16:04:10 BST
(In reply to Luke Kenneth Casson Leighton from comment #15)
> (In reply to vklr@vkten.in from comment #14)
> > Updated the cocotb-install script.
> > 
> > uri:
> > https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=cocotb-install;
> > h=67c7a572aca88c1448958e50c43bbeee46e5f0b7;hb=HEAD
> > 
> > Please review.
> 
> ok that seems to work - i didn't mean "remove python3-pip" however
> it does seem to work, including downloading cocotb_bus.

Install works without python3-pip, checked using fresh install.
Ran make tests with alteast one test passing each with verilator, ghdl and
iverilog. I had to rebuild ghdl fpic mismatch, see previous post.

Do you want me to add python3-pip for some reason.
Comment 18 Luke Kenneth Casson Leighton 2021-05-23 17:00:42 BST
no if it has succeeded including finding and installing cocotb_bus then it should be good.

you can check with ls /usr/local/lib/python3.7/dist-packages

cocotb_bus egg should be there
Comment 19 Veera 2021-05-24 09:30:33 BST
Updated pages for GHDL.

uri: https://libre-soc.org/HDL_workflow/
uri: https://libre-soc.org/HDL_workflow/ghdl/

Please review.
Comment 20 Veera 2021-05-24 09:47:28 BST
Updated pages for Icarus Verilog.

uri: https://libre-soc.org/HDL_workflow/
uri: https://libre-soc.org/HDL_workflow/iverilog/

Please review.
Comment 21 Veera 2021-05-24 10:26:56 BST
Updated pages for Cocotb.

uri: https://libre-soc.org/HDL_workflow/
uri: https://libre-soc.org/HDL_workflow/cocotb/

Please review.
Comment 22 Jacob Lifshay 2021-08-23 08:45:28 BST
luke: toml local dates have to be of the form 2021-01-23, you can't use 2021jan23.
https://toml.io/en/v1.0.0#local-date
toml follows https://tools.ietf.org/html/rfc3339
Comment 23 Luke Kenneth Casson Leighton 2021-08-23 09:30:38 BST
(In reply to Jacob Lifshay from comment #22)
> luke: toml local dates have to be of the form 2021-01-23, you can't use
> 2021jan23.
> https://toml.io/en/v1.0.0#local-date
> toml follows https://tools.ietf.org/html/rfc3339

thx, i couldn't remember, was going to sort it out when the error occurred by running budgetsync