Help simulating NOEL-V with GHDL

Hello,

I’m doing a master project with the NOEL-V, I was hoping somebody could help me resolve some doubts. I don’t have an FPGA at the moment, so I’m trying to do a simulation using GHDL. I have changed the TECHLIBS and other technology variables to inferred, but seems like there are some technology dependent components since I get an error because of missing the unisim libraries. What do I have to modify so I don’t require said libraries?

Also, if I get an FPGA in the future, is there support for co-simulation using an smaller Xilinx board? Or alternatively for any Altera board?

Thanks to all for your help!

Marc

Hello Marc,

Without knowing which design you are trying to simulate and what error message you see it is hard for me to help. The NOEL-V itself should not include any technology specific components when you set the VHDL generic tech (or memtech or favtech) to inferred. It is unclear if you have set the VHDL generic or only set the variable TECHLIBS in the makefile to inferred.

Do you mean by “co-simulation” to run and debug software on the NOEL-V processor running on the Xilinx board? This is possible, at the moment via GRMON (our software debug tool) and in the future also other solutions like OpenOCD. Both supports GDB debugging.

Regards,
Nils

Hi Nils,

Thanks for your answer, I am using the “noelv-xilinx-kcu105” template design. From what you said I think I did it wrong, I just set the TECHLIBS to inferred in the Makefile and FABTECH, MEMTECH, PADTECH and CLKTECH in the config.vhd file. I guess this is not enough as when executing make ghdl I get the following error: noelvmp.vhd:53:9: cannot find resource library “unisim”. Do I have to also modify the VHDLSYNFILES? Or how do I set the VHDL generic?

When I said “co-simulation” I meant to run a part of the core in a small FPGA and simulate the rest, but I don’t know which boards could I use for that.

Thanks again for your support!

Regards,

Marc

Hi Marc,

This particular template design uses unisim in the top level. The error message suggests shows that the dependency can be found on line 53 in the file noelvmp.vhd. Some hands-on modifications to remove all technology dependencies from the design will be needed.

Best regards,
Martin

Hi. I have similar problems. I want try use the GHDL as simulation tool with NOEL-V.
I´m using the noelv-generic design from grlib.
I did “make ghdl” and all looks good.
After I try “make ghdl-run” and in the end I receive this:

testbench
./testbench --assert-level=error --ieee-asserts=disable
make: ./testbench: No such file or directory
make: *** [../../bin/Makefile:502: ghdl-run] Error 127

After I force run the command:
ghdl -r --ieee=synopsys --workdir=gnu/work --work=work cat ghdl.path testbench

But I receive this message of error:

******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 3.0.0-dev (2.0.0.r834.ge74bc5870) [Dunoon edition]
Compiled with GNAT Version: 12.1.0
Target: x86_64-linux-gnu
/home/cgriscv/WorkShare/grlib-gpl-2022.2-b4274/designs/noelv-generic/
Command line:
ghdl -r --ieee=synopsys --workdir=gnu/work --work=work -Pgnu -Pgnu/grlib -Pgnu/techmap -Pgnu/eth -Pgnu/opencores -Pgnu/gaisler -Pgnu/work testbench
Exception ADA.ASSERTIONS.ASSERTION_ERROR raised
Exception information:
raised ADA.ASSERTIONS.ASSERTION_ERROR : trans-chap4.adb:302
Call stack traceback locations:
0x7f78cf70fab1 0x55822863cac0 0x558228648b8b 0x558228649174 0x5582285e25d7 0x5582285e282e 0x5582285e37f6 0x5582285e4240 0x55822866cfbb 0x558228668cad 0x5582286694ba 0x55822866926c 0x558228669539 0x55822866926c 0x558228669586 0x55822862a05a 0x55822861d85c 0x55822862ea43 0x558228628b5a 0x558228672213 0x5582285a7311 0x5582284b7b94 0x558228675b3b 0x55822823ee9f 0x7f78cf262d8e 0x7f78cf262e3e 0x55822823d3f3 0xfffffffffffffffe
******************************************************************

What I´m doing wrong? Wrong GHDL version?

Best Regards

Hi Marte,
What GHDL version are you using? From my experience, I’m not an expert on the subject, that issue is with the GHDL back-end. Only the GCC one generates the executable.
Try:

ghdl --version

And make sure you are using the GCC back-end.

Hope this fixes your issue!

Best regards,
Marc

Dear MarcSB,
This is my version:


GHDL 3.0.0-dev (tarball) [Dunoon edition]
Compiled with GNAT Version: 10.3.0
GCC back-end code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2022 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.


I ask about the same issue at GHDL forum and sounds be related with the GRLIB VHDL code style:

But sure when Gaisler/NOEL team develop the Makefile to run “make ghdl-run” everything runs well. Only need know which versions GHDL/GCC are used in that time.

Dear Marte,
My version is:


GHDL 1.0.0 (Ubuntu 1.0.0+dfsg-6) [Dunoon edition]
Compiled with GNAT Version: 10.3.1 20211117
GCC back-end code generator
Written by Tristan Gingold.

Copyright (C) 2003 - 2021 Tristan Gingold.
GHDL is free software, covered by the GNU General Public License. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Hope this helps you solve your issue!

Regards,
Marc

Hi!

We have made a number of changes to the GRILB code base which now should not lead to a crash. I tired running a simulation on the NOEL-V development branch yesterday and simulation with GHDL 2.0 still has some problems which we are currently looking into but a basic simulation should be working in the next release.

Best regards,
Jonathan

Dear Marc,
I try with GHDL 1.0.0 but I still get a similar problem (with ghdl-gcc happen the same):

******************** GHDL Bug occurred ***************************
Please report this bug on https://github.com/ghdl/ghdl/issues
GHDL release: 1.0.0 (Ubuntu 1.0.0+dfsg-6) [Dunoon edition]
Compiled with GNAT Version: 10.3.1 20211117
Target: x86_64-linux-gnu
/home/cgriscv/WorkShare/grlib-gpl-2022.2-b4274/designs/noelv-generic/
Command line:
/usr/bin/ghdl-mcode -m -fexplicit --ieee=synopsys --mb-comments --warn-no-binding -O2 --workdir=gnu/work --work=work -Pgnu -Pgnu/grlib -Pgnu/techmap -Pgnu/eth -Pgnu/opencores -Pgnu/gaisler -Pgnu/work testbench
Exception TYPES.INTERNAL_ERROR raised
Exception information:
raised TYPES.INTERNAL_ERROR : vhdl-errors.adb:30
Call stack traceback locations:
0x55ab314c0c12 0x55ab315749e5 0x55ab315743e0 0x55ab31574608 0x55ab31573fae 0x55ab315740ae 0x55ab31573e9e 0x55ab31573bb8 0x55ab31573dba 0x55ab31574a16 0x55ab315758a1 0x55ab315915a8 0x55ab31591847 0x55ab315776e0 0x55ab3157882c 0x55ab3155e3ce 0x55ab3155f238 0x55ab3160faa5 0x55ab3160fea2 0x55ab3160fb2e 0x55ab3160fb2e 0x55ab3160fb2e 0x55ab3161149b 0x55ab3161f04c 0x55ab316269a0 0x55ab3155b69e 0x55ab316e84b3 0x55ab31313b07 0x7f72c9e35d8e 0x7f72c9e35e3e 0x55ab31312243 0xfffffffffffffffe
******************************************************************

Best Regards

Hi Jonathan,
Thanks for your feedback. Have you idea when the next release will be available?
And a extra question (of topic): the NOEL-V is already ported and working in the BRAVE FPGAs?

Best Regards

Hi Marte!

You can follow the release schedule here: [NOEL-V](NOEL-V Information)
v8 of GRLIB has its planned release in December.
As for the second topic of BRAVE FPGAs, we offer support for BRAVE in the commercial release of GRLIB, however we do not know if anyone currently has tested NOEL-V with these FPGAs.

Best Regards,
Jonathan

Hi Jonathan,

I back try use GHDL in the NOEL-V in the new release (2023.1) but still not working :frowning:

Best Regards

“******************** GHDL Bug occurred ***************************
Please report this bug on Issues · ghdl/ghdl · GitHub
GHDL release: 1.0.0 (Ubuntu 1.0.0+dfsg-6) [Dunoon edition]
Compiled with GNAT Version: 10.3.1 20211117
Target: x86_64-linux-gnu
/home/cgriscv/WorkShare/grlib-gpl-2023.1-b4282/designs/noelv-generic/
Command line:
/usr/bin/ghdl-mcode -m -fexplicit --ieee=synopsys --mb-comments --warn-no-binding --warn-no-hide -O2 --workdir=gnu/work --work=work -Pgnu -Pgnu/grlib -Pgnu/techmap -Pgnu/eth -Pgnu/opencores -Pgnu/gaisler -Pgnu/work testbench
Exception TYPES.INTERNAL_ERROR raised
Exception information:
raised TYPES.INTERNAL_ERROR : vhdl-errors.adb:30
Call stack traceback locations:
0x55c0954dec12 0x55c0955929e5 0x55c0955923e0 0x55c095592608 0x55c095591fae 0x55c0955920ae 0x55c095591e9e 0x55c095591bb8 0x55c095591dba 0x55c095592a16 0x55c0955938a1 0x55c0955af5a8 0x55c0955af847 0x55c0955956e0 0x55c09559682c 0x55c09557c3ce 0x55c09557d238 0x55c09562daa5 0x55c09562dea2 0x55c09562db2e 0x55c09562db2e 0x55c09562db2e 0x55c09562f49b 0x55c09563d04c 0x55c0956449a0 0x55c09557969e 0x55c0957064b3 0x55c095331b07 0x7f0344e29d8e 0x7f0344e29e3e 0x55c095330243 0xfffffffffffffffe
******************************************************************”

Hi!

I can see that you are using a quite old version (1) of GHDL. I think your best bet is to try something newer, I haven’t tested the mcode version myself but building NOEL-V using the GCC version of GHDL works fine for me. I’m however building GHDL directly from their master branch GHDL 4.0.0-dev (3.0.0.r147.g6c56631a7) [Dunoon edition]. However, I do see that when trying to simulate I am getting a segmentation fault. I’ll look into the latter issue and see if there is something on our end which is causing this.

Hi everybody,
I am having the same issue with the grlib 2023 and ghdl 3.0 on a Mac. The Makefile as @Marte said earlier in this thread are still not working, and I have to force it using ghdl -r --ieee=synopsys --workdir=gnu/work --work=work cat ghdl.path testbench --vcd=gtkwave_waveform. This version of the GRLIB makes a segmentation fault, and the simulation stops. GTKwave shows not activity in clock neither reset. I hope @JonathanJ will dig into this and we can have this ready for the next release.
I am also having some troubles using VUNIT+ghdl with the GRLIB, and I wonder if someone is also trying to simulate it using vunit framework. The ghdl analyzer fails with duplicate instances i.e. procedures in grlib.stdio.vhd. This error occurs when vunit runs the analyzer to every file using the command is ghdl -a $path_to_grlib/stdio.vhd If I do not include the files that produce this error, vunit+ghdl simulates well. I just posted about this issue in the vunit gitter. I wonder if Gaisler’s people are aware of this issue.
Thanks!

The issue with vunit+ghdl resides in that the GRLIB does not fully compile with the standard 2008. It does with the standard 2002 though. GHDL uses by default what they call group 93, and it includes the 2002. If the GRLIB is simulated with ghdl, it runs without errors. However, VUNIT uses the standard 2008. It provides the option to pass the standard to libraries and files with add_source_file() and add_library(). This option works well in Modelsim. However, ghdl cannot mix different language standards. Although, I would like to see the GRLIB fully compatible with the std 2008, the work around is to avoid some files the gaisler/stdlib and a few debug only functions in some files i.e. ahbctrl.vhd, basically the ones which prints the information in the Amba bus.
I hope we will have a GRLIB fully compatible with the std 2008, not even mention the std 2019

I had time to dig this issue up today, and the GRLIB finally compiles with VUNIT+GHDL using vhdl-2002. As I pointed out in the previous message, the root cause is the GRLIB and the vhdl-2008. I posted this issue in the vunit gitter, and I messaged with Jim Lewis - who is chair of the IEEE 1076 VHDL Analysis and Standardization Working Group (VASG) and the founder of OSVVM (another great verification framework). He pointed out that the same issue

“For VHDL-2008, the versions of HREAD, HWRITE, … for std_logic_vector conflict (are ambiguous) with the ones for std_ulogic_vector because std_logic_vector is a subtype”. - Jim Lewis

He also suggested to comment the procedures declarations in the package, and just leave the Ulogic type. However, this cannot be done because the file testlib.vhd uses the procedures with the std_logic_vector inside the procedures with the same name but with Ulogic type. The error is easy to solve just updating the stdio package with vhdl-2008. These functions, and other functions in the stdio are used only in simulation. I do not remember if I also had this same error using Modelsim and vhdl-2008, but Jim also mentioned that even the errors are not showed up in other tools, it will be unusable due to ambiguity

“In 2008, other tools may not give you an error for this, but the functions will be unusable due to ambiguity.” - Jim Lewis

The other option that is valid (for me) is to remove the stdio package, and also remove from other files the code that calls to print (or toast) information during simulation. This is not ideally because I would like to see debug information, but once the GRLIB is up and running, that information is irrelevant if VUNIT (or OSVVM, CocoTB, UVM) is used for verification

Regards

Hi, I found the reason why the segmentation fault occurred. Our simulated memory model ahbram_sim uses a large signal array, signals and variables in vhdl behave quite differently and in this case the memory footprint is heavily affected. Furthermore, in this case the signal is only used within one process, hence a variable is more suitable. I changed the ram model to be variable based instead and the simulation no longer crashes.

Hopefully this change can make it into the next release, but in the meantime here is a manual patch for /lib/gaisler/sim/ahbram_sim.vhd

--- a/../../../../grlib/lib/gaisler/sim/ahbram_sim.vhd
+++ b/ahbram_sim.vhd
 -- Entity:  ahbram
 -- File:  ahbram.vhd
@@ -83,7 +101,7 @@ signal ramdata  : std_logic_vector(dw-1 downto 0);
 signal hwdata   : std_logic_vector(dw-1 downto 0);
 
 type ram_type is array (0 to (2**ramaddr'length)-1) of std_logic_vector(ramdata'range);
-signal ram : ram_type;
+-- signal ram : ram_type;
 signal read_address : std_logic_vector(ramaddr'range);
 
 begin
@@ -282,13 +300,14 @@ begin
   variable recaddr : std_logic_vector(31 downto 0);
   variable reclen  : std_logic_vector(7 downto 0);
   variable recdata : std_logic_vector(0 to 16*8-1);
+  variable ram : ram_type;
 
   begin
     if rising_edge(clk) then
       if conv_integer(write) > 0 then
         for i in 0 to dw/8-1 loop
          if (write(i) = '1') then
-           ram(to_integer(unsigned(ramaddr)))(i*8+7 downto i*8) <= hwdata(i*8+7 downto i*8);
+           ram(to_integer(unsigned(ramaddr)))(i*8+7 downto i*8) := hwdata(i*8+7 downto i*8);
          end if;
         end loop;
       end if;
@@ -296,7 +315,7 @@ begin
     end if;
 
     if (rst = '0') and (FIRST = true) then
-      ram <= (others => (others => '0'));
+      ram := (others => (others => '0'));
       
       L1:= new string'("");
       while not endfile(TCF) loop
@@ -332,7 +351,7 @@ begin
               ofs := conv_integer(recaddr(log2(dw/32)+2 downto 2));
 
               for i in 0 to wrd-1 loop
-                ram((ai+i)/(dw/32))(dw-32-(32*(i+ofs) mod dw)+31 downto (dw-32-32*(i+ofs) mod dw)) <= 
+                ram((ai+i)/(dw/32))(dw-32-(32*(i+ofs) mod dw)+31 downto (dw-32-32*(i+ofs) mod dw)) := 
                 recdata(i*32 to i*32+32-1);
               end loop;
 
@@ -348,9 +367,9 @@ begin
       
     end if;
 
+    ramdata <= ram(to_integer(unsigned(read_address)));
   end process RamProc;
   
-  ramdata <= ram(to_integer(unsigned(read_address)));
 
   reg : process (clk)
   begin