EE 3060 - FAQ


Questions on Verilog

Modelsim won't compile this: nibble = word[pos+3:pos]. What do I do?
Replace it with this: nibble = word >> pos (assuming nibble is four bits). Follow this link for other Leonardo-synthesizable ways to read part of a vector, along with their costs.
Back to Questions


Modelsim won't compile this: word[pos+7:pos] = byte. What do I do?
Replace it with this:
     for(i=0; i<31; i=i+1) if( i[4:3] === pos[4:3] ) word[i] = byte[i[2:0]];
assuming pos is a multiple of 8. Follow this link for other Leonardo-synthesizable ways to write part of a vector, along with their costs.
Back to Questions


The simulator gives me "Error: === operator invalid for REAL" messages. To make matters worse, it doesn't give a line number! Why?
Reals cannot be compared with the case comparison operator, ===. To find the offending line select "Simulation" from the ModelSim "Options" pull-down menu. A "Simulation Options" tabbed dialog should appear. Click the "Assertions" tab and select "Warning" under the "Break on Assertion" group. Click okay and ru-run the simulation, it should stop at the offending line.

Note that the simulator considers constants to be reals if they were computed using an expression containing reals. For example, 3 and 12/3 are integers but 10/2.5 is considered a real even though 4 is an integer. As a workaround assign the parameter to an integer and use that.
Back to Questions



Questions on Synthesis

Nothing happens when I try to start Leonardo using the slide-up menu. If I try to start it from a shell it ends after printing "Setting up registry" and "Abort". There are no problems when synthesizing from Emacs with S-F9 or using the tclscript, syn.tcl, but I want my GUI!!!
This worked on two occasions in the Spring 2001 semester. Delete directories .leonardo_spectrum and windows which should be in your home directory. You can use the commands:
cd
/bin/rm -R .leonardo_spectrum and windows which
/bin/rm -R windows
Be careful with the /bin/rm -R command, which deletes a directory and its contents.
Back to Questions


How do I simulate synthesized modules?
Using the Leonardo GUI

First run the flow on your Verilog input and make sure it completes. Next, select the output tab. In the "Downto" area, select "Primitives". Note the file name in the "Filename:" field or change it to whatever you want. (Be careful not to overwrite your original HDL code.) To write the output click the "Write" button. Use Modelsim to compile and simulate the synthesized description.

Using the Emacs Text Editor

Load the file containing the Verilog code in to a buffer. Press "C-F9". (C-F9 is control F9.) The output of the synthesis program and, if synthesis was successful, the compiler, should appear in a window. Use Modelsim to simulate the synthesized description. If Modelsim is running, click restart to load the synthesized module. One can quickly go between simulating the original code and synthesized code by pressing either F9 (original) or C-F9 (synthesized) and pressing reload in Modelsim. This will synthesize for the sample ASIC target. To change the technology target or other synthesis options copy /home/classes/ee4702/files/tcl/syn.tcl and make the appropriate edits.

Using the Command Line

To synthesize and compile foo.v enter command    syn.tcl foo.v    to the shell. If Modelsim is running and the module was loaded, press reload.

Back to Questions



Questions on Exams

What can I bring to the midterm exam?

The exam is closed book, you can bring a 216 mm × 280 mm note sheet (and use both sides). It might be convenient to print out the Qualis quick reference card, tape the two sides together, and add your own marginalia.

Back to Questions



Questions on Specific Assignments

In Spring 2001 Homework 4, can I base my solution on the posted solution to Homework 3?
Yes.
Back to Questions


In the bean counter what does
   assign next_bean_time = new_clump_pd2 ? {1'b0,gap_timer[15:1]} :
                           bean_time === 0  ? gap_time : bean_time-1;
do?

Here, the conditional operator is being used twice. Recall that  a ? b : c  evaluates to b if a is true or to c if a is false. (A special case occurs when a is undefined, the result is undefined unless b and c are the same.)

To understand what the expression does, first parenthesize it:

 assign next_bean_time = new_clump_pd2 ? {1'b0,gap_timer[15:1]} :
                           ( ( bean_time === 0 ) ? gap_time : (bean_time-1) ) ;

Because the conditional operator has the lowest precedence of all operators, parenthesis are put around all other expressions first, in this case bean_time === 0. Because the conditional operator has right-to-left associativity bean_time === 0 is an argument of the second conditional operator.

Here is how the expression is evaluated: First, new_clump_pd2 is evaluated. If it's true, {1'b0,gap_timer[15:1]} is assigned to next_bean_time. If it's false then the second conditional, ( ( bean_time === 0 ) ? gap_time : bean_time-1 ) is evaluated: If ( bean_time === 0 ) is true, gap_time is assigned to next_bean_time, otherwise bean_time-1 is assigned.

Back to Questions



Questions on the ModelSim Software

When I try to start the simulator using the slide-up menu nothing happens.
It's possible that the design database is locked. If there's a file named "_lock" in the work directory delete it. Another option is to delete the entire work directory and recreate it.
Back to Questions


When I try to run the simulator, **poof**, the windows disappear! What happened?
This happens when your disk quota is exceeded. Delete files that end in .wlf. (Don't do this while running the simulator. If you're using the file manager, don't just throw them in the trash, shred them too. Interestingly, files take up less after being shredded. :-) . Use du | xdu from your home directory to find where space is being used.
Back to Questions


When I tried to compile Verilog a dialog popped up titled "Error in Tcl Script" containing an unhelpful error message. What's going on?
This happens when you click a compile button or select a compile menu entry when a compile window is already open. Click "Ok" in the dialog and look for the original "Compile HDL Source Files" dialog.
Back to Questions


I tried using the array of instances syntax shown in the Ciletti book on page 49   (nor [0:7](y,a,b);)   but the compiler won't accept it. Not only that, it won't accept a repetition multiplier used with the concatenation operator (Ciletti, page 108, example 4.27b), for example,   ( assign ohoneohone = {2{2'b01}};).   What's wrong?
Alas, ModelSim (Version 5.3) does not support arrays of instances, nor (See the Version 5.3 user manual, page 5-64.) The repetition operator is not listed as unimplemented, but I can't get it to work either.
Back to Questions



Questions on the Workstations, Operating System, etc.

Which hosts can I telnet into?
Choose one of these: babble.ece.lsu.edu,   batch.ece.lsu.edu,   buz.ece.lsu.edu,   chip.ece.lsu.edu,   delta.ece.lsu.edu,   fuzzy.ece.lsu.edu,   image.ece.lsu.edu,   isa.ece.lsu.edu,   mars.ece.lsu.edu,   oberon.ece.lsu.edu,   optimal.ece.lsu.edu,   pop.ece.lsu.edu,   serial.ece.lsu.edu,   uranus.ece.lsu.edu.
You might want to check the workstation load by running top. If the load averages (average number of processes ready to execute) are above 0.5 you might want to log in elsewhere.
Back to Questions


Can I run the simulator and other graphical software from my PC or Mac at home?
Yes. You'll first need to install an X-server on your computer. On a dialup connection text editing is a bit sluggish and graphics (such as selecting a menu item) are painfully slow (but usable in an emergency). On a broadband connection (cable modem, DSL, T1-equipped apartment building, etc) graphics are merely sluggish. See the procedures page for instructions on setting up an X-server and connecting to our system.
Back to Questions


My workstation has what looks like a floppy disk drive. How can I copy files to a floppy disk?
Use the command mcopy foo.v a:. See the mtools manpage for other floppy commands. (From a shell: man mtools or xman then search for mtools. From Emacs: M-x man then enter mtools.)
Back to Questions


I get disk quota exceeded messages. Should I be concerned?
Yes. You have two disk space quotas, a lower one and a higher one. To find your quota and the amount of space used enter the command  quota -v . The number under the usage column is the amount of space used, the number under "quota" is the lower quota and the number under "limit" is the higher quota. If your usage is between the two limits you'll get warnings for several days, then you won't be able to use more disk space. ("Time left" refers to the amount of time until this happens.) You will never be allowed to exceed your higher quota. To get a graphical representation of how much space things take up issue  du | xdu  in a shell from your root directory.
Back to Questions



ECE Home Page Course Home Page
David M. Koppelman - koppel@ece.lsu.edu
Modified 13 Feb 2002 16:46 (2246 UTC)