Icarus verilog mac os

Содержание
  1. Icarus verilog mac os
  2. What Is Icarus Verilog?
  3. Where is Icarus Verilog?
  4. A Test Suite?
  5. Who is Icarus Verilog?
  6. Icarus verilog mac os
  7. Simulation Issues
  8. My program compiles, but it complains about «system.vpi». So how do I run my program?
  9. My program compiles under Solaris, but when I run it I get a relocation error with «system.vpi». So how do I run my program?
  10. Why is it that «if (2’b01 & 2’b10). » doesn’t run the true case? Is Icarus Verilog Broken?
  11. My «always» statement doesn’t trigger at time 0. Is Icarus Verilog broken?
  12. I want pretty pictures (wave forms) of my simulation run.
  13. VPI Issues
  14. How do I compile my VPI module?
  15. How do I install my VPI module?
  16. Synthesis
  17. You mean XNF synthesis works?!
  18. What else do I need to make working Xilinx Designs?
  19. How do I make XNF macros?
  20. How do I make EDIF macros?
  21. I figured out how to make flip-flops, but how do I initialize them?
  22. How do I make a RAM in a CLB?
  23. I want to work entirely within Linux? How do I do PAR?
  24. Why XNF and not EDIF?
  25. About Icarus Verilog In General
  26. Are there any precompiled binaries?
  27. The symbol «lexor_keyword_code» is undefined when I compile ivl.
  28. I have RedHat 7.0 and Icarus Verilog won’t compile. What’s wrong?
  29. What about gcc 3.X?
  30. What about bison 1.30?
  31. Parse.cc won’t compile. The compiler crashes. What’s up with that?
  32. I get «virtual memory exhausted» when compiling the compiler.
  33. The Makefile is broken, and I’m on *BSD. What’s up with that?
  34. Does it run under Windows?
  35. I get Linker errors linking system.vpi under Cygwin. How do I fix it?
  36. Does it run under Mac/OS?

Icarus verilog mac os

What Is Icarus Verilog?

The compiler proper is intended to parse and elaborate design descriptions written to the IEEE standard IEEE Std 1364-2005. This is a fairly large and complex standard, so it will take some time to fill all the dark alleys of the standard, but that’s the goal.

Icarus Verilog is a work in progress, and since the language standard is not standing still either, it probably always will be. That is as it should be. However, I will make stable releases from time to time, and will endeavor to not retract any features that appear in these stable releases. The quick links above will show the current stable release.

The main porting target is Linux, although it works well on many similar operating systems. Various people have contributed precompiled binaries of stable releases for a variety of targets. These releases are ported by volunteers, so what binaries are available depends on who takes the time to do the packaging. Icarus Verilog has been ported to That Other Operating System, as a command line tool, and there are installers for users without compilers. You can compile it entirely with free tools, too, although there are precompiled binaries of stable releases.

Where is Icarus Verilog?

Development snapshots are made fairly often, and made available in the FTP directory . The files are gzip compressed tar files that contain the source and makefiles. These snapshots follow development progress, and, although the latest features are included in this source, compatibility from snapshot to snapshot is not guaranteed.

And finally, the current «git» repository is available for read-only access via anonymous git cloning. This allows for those who which to track my progress and contribute with patches timely access to the most bleeding edge copy of the source. Access the git repository of Icarus Verilog with the commands:

From here, you can use normal git commmands to update your source to the very latest copy of the source. See the Installation Guide for details on how to access and compile the git repository.

A Test Suite?

There is also a test suite available. The test suite is also accessible as the ivtest github.com project, available here: . Access the git repository of the test suite with the command:

Since the test suite is simply an ongoing accumulation of tests, there are not typically any releases, per se. Only the git source.

Who is Icarus Verilog?

There is also a cast of characters who have contributed patches, tests, and various bits to the project. See the git logs to get an idea of the breadth of the contributor base. I’ll be adding a credits page someday, although the source distributions do in general name names.

The mailing lists for Icarus Verilog are hosted by sourceforge.net, so go there for mailing list archives and instructions on joining; but it is often discussed in the gEDA mailing lists as well. See the gEDA home page for information about that project, and information about how to join the mailing list. While you are browsing the gEDA web site, notice all the other nifty EDA related tools that are there. While Icarus Verilog is not literally part of the gEDA project, we cooperate and try to support each other. Icarus Verilog users are often gEDA users as well.

Источник

Icarus verilog mac os

This version of the FAQ is obsolete, and is preserved for historical reasons. For the actual FAQ (and other documentation) go to the Iverilog Wikia.com wiki. The Icarus Verilog home page has moved to http://iverilog.icarus.com.

Simulation Issues


My program compiles, but it complains about «system.vpi». So how do I run my program?

In very old versions of Icarus Verilog, you needed to set the environment variable VPI_MODULE_PATH to point to the system.vpi file that was installed when you installed Icarus Verilog. Normally, this is installed in «/ usr/local/lib/ivl » so you need that directory in your VPI_MODULE_PATH .

The situation has improved since then. Released version 0.2 and later include the module path in the generated code, so that the environment variable is not needed. However, you can still get the error message if you move the root of the installation, or if you try to run the compiled program to a system that doesn’t have the VPI modules.

As of version 0.5 and later, the situation is even better, assuming you are running a program compiled with the -tvvp target. A compiled program (in vvp format) can be copied around freely, and the local vvp command will use the local path to find the vpi modules.

However, complaints about user compiled VPI modules not being found still persist. The Icarus Verilogvvp run-time needs to be told to look for vpi modules other then system.vpi, and if the module is not installed in the system default location, it needs to be told where to look for user compile modules. The «-m» and «-M» modules are both pertinent, and need to be looked up in the vvp and iverilog man pages.

Читайте также:  Полезные службы для принтера windows

My program compiles under Solaris, but when I run it I get a relocation error with «system.vpi». So how do I run my program?

In this case, you are finding system.vpi fine, but there is some confusion with linkers under Solaris.

It seems that everybody has g++ installed on their Solaris systems, but typically the native linker is used, as opposed to the GNU ld linker. This is fine. The configure script assumes this case and forms up the right set of linker parameters for linking programs that iverilog compiles. However, if the GNU linker is installed, those link parameters are not correct, and VPI modules will fail to load.

If you have a Solaris system with the GNU linker installed, and you have this problem, edit the generated Makefile in the Icarus Verilog source, and replace the » rdynamic= » line with this:

You then need to recompile and reinstall the iverilog command. (No need to recompile ivl or ivlpp .) I’d gladly entertain suggestions for how to fix iverilog to cope with this situation at runtime, since the precompiled Solaris binaries are configured to assume the native linker, instead of the GNU linker.

Even better would be to fix g++ on Solaris to do the right thing with the — rdynamic flag, like it does on many other systems. Ah, well.

As of Icarus Verilog 0.5, these issues no longer apply as it no longer uses gcc in the backend. The easiest way to deal with Solaris, therefore, is to use Icarus Verilog 0.5 or later.

Why is it that «if (2’b01 & 2’b10). » doesn’t run the true case? Is Icarus Verilog Broken?

This is a popular coding error. You used the bit wise AND operator (&) where you meant to use the logical AND operator (&&). I no longer make this particular error in my own Verilog code because I received so many spurious bug reports about this that it’s burned into my brain:-) Icarus Verilog has its share of bugs, but this is not one of them.

My «always» statement doesn’t trigger at time 0. Is Icarus Verilog broken?

In this case, the bug is most likely in your program, and is probably the most common and unnoticed error in the entire history of Verilog use. Your program probably looks something like this:

reg [7:0] a, b, c;
always @(a or b) c = a + b;
initial begin a = 1; b = 2; end

This is in fact a race condition at time zero. James Lee has this to say:

[T]he bug is the race between the always at time zero getting to the @ and the initial setting the values. A #1 in the initial block before changing a or b should do the trick.

I think that most verilog simulators have some sort of trick to catch the changes at time zero.

The IEEE 1364-1995 standard is also clear on this issue: the given example leaves c with an unpredictable value at time 0. This is a frightfully common mistake, we’ve all done it. It often goes unnoticed because compilers often start threads from first (in the source file) to last. It just so happens that Icarus Verilog, by a detail of implementation, starts threads from last to first.

What people don’t typically realize is that «#0 » has a well defined meaning. I suggest that you preceed statements in your initial processes with a «#0» to eliminate the race, like so:

reg [7:0] a, b, c;
always @(a or b) c = a + b;
initial #0 begin a = 1; b = 2; end

This improved version doesn’t have a time-0 race—if the initial block is scheduled ahead of the always block, the «#0» will tell the scheduler to first yield to all other threads, then continue.

I want pretty pictures (wave forms) of my simulation run.

Well, you are in luck. As of version 0.2, Icarus Verilog supports VCD output. You need to learn about the $dumpfile and $dumpvars system tasks from any good Verilog reference, and use them. The output VCD dumps can be viewed by commercial wave form viewers, and my personal favorite, GTKWave. Note that gtkwave development has changed hands.

I also keep a version of GTKWave that is known to work with the most recent version of Icarus Verilog here: . This directory includes source and a variety of precompiled binaries. The release mirrored on Icarus.com is a 1.X release, whereas the current development version is 2.X.

VPI Issues


How do I compile my VPI module?

The easiest way to do that is use the iverilog-vpi command. This handles your platform details, so all you need to do is give it the source C files, a it gives back a vpi module. See the iverilog-vpi manual page for details.

How do I install my VPI module?

You don’t need to (You can use the -M flag to vvp to locate it) but if you wish, you can copy it to the /usr/lib/ivl directory, or /usr/local/lib/ivl directory, depending on where Icarus Verilog was installed on your system.

Synthesis

NOTE: Most of the synthesis capabilities of Icarus Verilog appear after the v0.1 stable release. Although the 0.1 release can produce XNF files, its ability to synthesize logic from behavioral code is not in general powerful enough to use. The development snapshots leading up to v0.2 have improved the situation, so the following answers will be describing development and 0.2 or later versions. Starting with v0.7, synthesis is greatly improved again, this time to a professional level. There are still significant limitations in synthesis, but the greatest remaining issue is code generator for various target types.

You mean XNF synthesis works?!

Sure does. It’s still under development, so version 0.1 doesn’t officially support XNF synthesis, but version 0.2 and later do. See the x nf.txt file distributed with Icarus Verilog.

As of 0.6, Icarus Verilog also supports more general synthesis with the -tfpga code generator, described in the fpga.txt file. This also starts the move towards EDIF as the netlist format. Most (all?) FPGA vendors and ASIC P&R tools support EDIF as an input netlist format, so the change is inevitable. However, the real problem is not the netlist format, but the detailed code generator that supports the technology family in question.

Читайте также:  Динамический инородный диск windows

Currently, FPGA synthesis is weighted heavily towards Xilinx devices, partly because of the support that I have received from Xilinx. Other device families can be supported as well if I were to receive similar support from the vendor, or other motivated entity with the proper resources.

What else do I need to make working Xilinx Designs?

Besides Icarus Verilog, you will need Alliance or Foundation software packages from Xilinx to place-and-route and to generate configuration bit streams. Unfortunately, Xilinx does not yet directly support Linux so you will have to copy the XNF and NCF files that Icarus Verilog generates onto a supported (in other words, «Windows») platform.

Rumor has it that Xilinx Alliance tools for Windows can be run under Linux using WINE. Only the command line tools are reported to work this way, but this should be enough to get you a bit file. If you feel daring, try this: .

As of RedHat 7.2 and Xilinx ISE 4.2i, Xilinx claims to support the back-end tools via the WINE application layer. There are Xilinx APP Notes on the subject (search the Xilinx web site for details) but in the real world this support draws mixed reviews. I personally have not been able to get it to work, but others claim success. However, It seems clear that the best path is to continue reminding Xilinx that we really want native Linux support.

How do I make XNF macros?

Icarus Verilog will automatically generate the EXT records needed for XNF linkers to include XNF code generated by Icarus Verilog. All you do is synthesize a module that has ports, an the generated XNF will include the PIN= attributes to make the ports visible outside the generated macro. See the xnf.txt file for details.

How do I make EDIF macros?

As of 0.6, Icarus Verilog is moving towards the more sophisticated -tfpga code generator. As with the older XNF code generator, the ports of a root module are made into interface ports of an EDIF macro. As ov v0.7, the sqrt-virtex.v example is bundled as an example of how to make parts and macros using the -tfpga code generator.

I figured out how to make flip-flops, but how do I initialize them?

CLB flip-flops can be initialized to 0 or 1. You can force them to take on a specific value by assigning the desired value in an initial statement, like so:

Note that this example uses the 1364-2000 reg initial assignment syntax, but you can get the same effect like so:

Either way, the compiler will detect the initial assignment to the flip-flop output and will generate the correct INIT= parameter to the XNF device.

How do I make a RAM in a CLB?

As of released version 0.2, Icarus Verilog can recognize memories as RAMS and generate XNF synchronous RAM devices, if:

The memory assignment is a clocked behavioral assignment,

Reads from the memory are asynchronous,

And all the address lines are shared by the read and write statements.

Icarus Verilog will try to generate the smallest ram needed to support the memory. If the memory has width, then enough rams will be generated to accomodate the data width.

I want to work entirely within Linux? How do I do PAR?

News FLASH! As of Foundation 4.2i, Xilinx officially claims Linux support, although only for the X86 architecture. Foundation 4.2i is supposedly supported on RedHat 7.2 using the Wine appications layer, with future plans for a native port of the newer ISE tools. For the word from Xilinx, go here: .

Why XNF and not EDIF?

NOTE: This answer (and indeed the question itself) is obsolete. Icarus Verilog synthesis now favors using EDIF.

Xilinx has found a way to be difficult. While the XNF specification is available for free download, the Xilinx libraries for EDIF are not. However, although XNF is supposed to be obsolete, there are some big name design entry tool vendors that haven’t made the change over to EDIF so XNF will be around for a while.

As of 0.6, EDIF is supported with the -tfpga target. In fact, that target now supports more of the Virtex features then the XNF target, and newer part types will only be added to the fpga target, not the xnf target.

During the course of 0.7 development, Xilinx has become considerably more helpful, so as long as this support keeps up, the only limitation remaining is the time needed to do the work of supporting the various part types. Keep following the geda-dev mailing lists for the latest progress.

Another advantage of the -tfpga target is that other vendor’s PAR tools can also be supported similarly, and that is in the works. It is low priority, however, because other FPGA vendors lack UNIX/Linux support.

About Icarus Verilog In General


Are there any precompiled binaries?

Yes, for Linux (i386 and alpha), Solaris/SPARC, NetBSD/everything and Windows. Look in . In some cases, there are actually pointers to other sites that store and maintain the actual binaries. I personally only maintain the Linux and Windows binaries. The others are available thanks to the generous efforts of volunteers who take the time to compile and test on their favorite platform. These are generally only of the stable release. The development snapshots are distributed in source form only.

The symbol «lexor_keyword_code» is undefined when I compile ivl.

The source file l exor_keyword.cc is actually generated from lexor_keyword.gperf . The program that does this conversion is called gperf and you need version 2.6 or later. (I use version 2.7.) Linux distributions generally include gperf , although it is not necessarily installed. It is also available for NetBSD and FreeBSD and all the other UNIX variants. Check the version of an installed gperf with the command « gperf —version ».

If you discover that you are missing gperf, or that your installed version is out of date, you must install the correct version, then remove the lexor_keyword.cc file so that it is regenerated. Then just remake and the compile and link should complete properly.

Читайте также:  Курсор выходит за пределы экрана windows 10

All this is to a degree moot, however, because even snapshots should come with a premade version of lexor_keyword.cc . You will only need to create this file for yourself if you are accessing the source via CVS, or if you are editing the lexor_keyword.lex source file.

I have RedHat 7.0 and Icarus Verilog won’t compile. What’s wrong?

There have been many problems with the gcc 2.96 compiler that RedHat included with the 7.0 release. Some of those problems impacted Icarus Verilog. The end result is that you need snapshot 20001104 or later to compile on RedHat 7.0. The stable versions 0.4 and later also work. There are other issues regarding 2.96 on the gcc home page. In particular, look here; but be aware that the problem is even worse then this page clearly states. In any case, if you must upgrade to RedHat 7.0, be prepared to live with recent snapshots of Icarus Verilog.

RedHat has been informed of problems that are tickled by Icarus Verilog. If you care, check out buzilla , and look for bug number 20267 . As of Icarus Verilog 0.6, compile problems have been dealt with.

What about gcc 3.X?

The 0.5 release (and later) compiles with gcc 3.0. The source before 0.5 does not compile with gcc 3.0, but there’s no real reason to use anything older then the 0.5 release anyhow. The latest C++ from gcc still (as of v0.7) leads to a warning about support for , but it still works, and the post-0.7 development cycle should deal with it.

What about bison 1.30?

Somewhere between version 1.28 and 1.30 of bison, the powers that maintain bison made several incompatible changes: they changed the name of output files that are generated, and they changed the structure of the default yylloc type, and they changed a few other things. Many of these changes cause build problems with Icarus Verilog.

The typical bug report related to this is here: This bug report includes the fix needed, in the form of a patch to the 20011230 snapshot. Snapshots after 20011230 are fixed to account for the new bison, and the 0.6 release also includes the needed changes.

And then they changed it yet again, and the v0.7 release includes even more changes to account for different versions of bison. As of the 0.7 Release, most versions of bison compile Icarus Verilog, so I think I’ve got it licked. At least for now.

Parse.cc won’t compile. The compiler crashes. What’s up with that?

If you are compiling Icarus Verilog, you are probably aware that it is written in C++. Unfortunately, the parse.cc file (which is generated from parse.y by bison) tickles some performance problems in the GNU C++ compiler. So, you need either a lot of memory (a lot of memory) or plenty of swap and lots of patience to compile parse.cc. It does work, though. If your compiler crashes, it is probably from lack of virtual memory.

If umpteen gazillion megabytes is somewhat out of your reach, and prayers to the gcc gods/godesses come to naught, try convincing the compiler to not optimize when compiling this file. You can get the desired effect by compiling just this file with the command:

Note that once you get past compiling ivl, its run time demands are not so great.

After version 0.5, this problem seems to have largely vanished.

I get «virtual memory exhausted» when compiling the compiler.

See above. You’re probably having trouble with parse.cc, which is generated from parse.y. What can I say, you need more ( lots more) memory. Try adding 256MB of temporary swap or use the technique in the previous FAQ entry. Or try precompiled binaries for your platform. If you are compiling under cygwin32, see the cygwin.txt text file.

The Makefile is broken, and I’m on *BSD. What’s up with that?

Icarus Verilog makefiles make use of GNU make extensions. BSD based systems such as NetBSD and FreeBSD tend to have a BSD style make program. In standard FreeBSD systems, the GNU make program is available as gmake . That may be true with NetBSD as well. Use that and you will be fine.

For systems like Solaris, you may need to download GNU make from the usual GNU sites.

Does it run under Windows?

Yes, as of the 0.5 release. Each release directory includes a Windows subdirectory which includes the installer that you use to install a precompiled binary of the 0.5 release. The snapshots can also be compiled yourself. The instructions for the compile are in the mingw.txt file.

Note that compiling with the MSVC++ compiler is not supported, and never will be. There is no point. Also, the Cygwin support is being deprecated for the mingw port, although as explained in the mingw.txt file, you will need Cygwin if you plan to compile Icarus Verilog .

There is also an alternative source for Icarus Verilog for Windows, at . This package is managed by Pablo Bleyer Kocik.

I get Linker errors linking system.vpi under Cygwin. How do I fix it?

When compiling under recent binutils installed, you will see complaints about _bss_end__ and _bss_start__ and some similar symbols when trying to link system.vpi. This appears to be a problem with the binutils package. binutils-20001029 does not play nice with Icarus Verilog . Downgrade to the 20000625 version and you should be OK for now.

The ivl-bugs PR#58 is available to track this particular issue.

Does it run under Mac/OS?

The MacOS (before macosX) port is obsolete. There are ancient precompiled binaries available for download from the Icarus Verilog FTP site, as tarballs and hqx files. There is also a README.txt file that describes how to install and run the Macintosh port. Note that this is done by a volunteer, and I have no idea how he accomplished this little miracle.

Mac O/S X, however, is in good shape and compiles Icarus Verilog out of the box. There are some minor bits of preparation needed to compile on MacOSX, so see the » macosx.txt » file in the source distribution.

This page is Copyright 2001-2004 Stephen Williams

Источник

Оцените статью