Thursday, August 24, 2017

Palladium Tips

* To pre-allocate specific domains for a palladium database to run on in a script, we can use xeset command. The following is an example
debug . -session new2
xeset bpValue {0.5 0.6}
host cemulx120
download
...



* Use Verigen to generate gate-level schematics

We can do this via command line or via xeDebug GUI.
a. Use xeDebug GUI
There is a RTL/Gate tab in xeDebug GUI.

In the above, we added the instance of "." and generated verilog file of default.v. The instance of "." represents the root of the design.

b. Directly use command at command line.
verigen USERLIB TEST_WRP -inst . -out default.v -bus

In the above, USERLIB is the library, TEST_WRP is the top level design cell.

* How to debug ribbon cable connection and PIN assignment for palladium database

For example, we know PIN_WE_CE0_CH0 is supposed to connect to the WE pin of Channel 0 CE0 of a NAND daughter card. We can remove NAND from the daughter card to avoid it to drive the signal. Then we can force PIN_WE_CE0_CH0 to low and measure the voltage of the WE input. Then force PIN_WE_CE0_CH0 to high and measure the voltage of the WE input of the daughter card. If the voltage measured matches with the high/low level of the daughter card input, then the PIN assignment/ribbon cable connection for this signal is correct.





Sunday, April 30, 2017

DDR3 Timing


Reference
-----------
1. How to use SDRAM User's Manual (ELPIDA)
2. How to use DDR SDRAM User's Manual(ELPIDA)
3. How to use DDR2 SDRAM User's Manual(ELPIDA)

Monday, April 17, 2017

A Simple UVM Example for Beginners

Ref [1] is a very good UVM guide for beginners. Ref[2] provides source codes for the examples used in Ref [1]. Below are the steps to try the example out.

QuickStart to Run the Example
----------------------------------------
1. Create a simulation directory and let's use $SIMULATION to represent the directory.
2. Download the source codes for the example UVM codes from Ref [2] and extract it under $SIMULATION. This generates a directory of $SIMULATION/uvm-testbench-tutorial-simple-adder-master.
3. Create a directory $SIMULATION/uvm-src.
4. Download the UVM 1.2 or UVM 1.1d source codes from Ref [3] and extract it under uvm-src. This creates a directory of $SIMULATION/uvm-src/uvm-1.2 or $SIMULATION/uvm-src/uvm-1.1d.
5. Switch to the directory of $SIMULATION/uvm-testbench-tutorial-simple-adder-master.
6. If UVM 1.2 source code is used in step 4, we need to edit the UVM_HOME variable in the file of Makefile.vcs.

Change
UVM_HOME = ../uvm-src/uvm-1.1d
to
UVM_HOME = ../uvm-src/uvm-1.2

If uvm-1.1d was downloaded in step 4, we can skip this step.
7. Set up vcs environment so that vcs program can run.
8. Run "make  -f  Makefile.vcs


Add Waveform Dumping Feature
------------------------------------------
Ref [4] and Ref [5] are two good references of how to use vcs to dump waveform. Below are my working steps.

1. Added the following in the test-bench code of simpleadder_tb_top.sv.

`ifdef DUMP_FSDB
initialbegin
  $fsdbDumpfile("test.fsdb");
  $fsdbDumpvars;
end
`endif

2. In Makefile.vcs, added below options for vcs to compile the test-bench to do waveform dumping.

+define+DUMP_FSDB \
-P $(NOVAS_HOME)/share/PLI/VCS/LINUX/novas.tab $(NOVAS_HOME)/share/PLI/VCS/LINUX/pli.a \

NOTE:  The environment variable NOVAS_HOME was set to the path of the verdi install directory in my environment.

3. Run "make -f Makefile.vcs" again. The file test.fsdb is generated during the simulation and I can run "verdi -ssf test.fsdb" to view the waveform generated.

If removing "+define+DUMP_FSDB" option for vcs in step 2, then the code added in step 1 won't take effect and test.fsdb will not be generated.

Both Ref[4],[5] mentioned add $(NOVAS_INST_DIR)/share/PLI/lib/$(PLATFORM) as one of $LD_LIBRARY_PATH searching paths. But the experiment shows this is not needed.

References
-------------
1. https://colorlesscube.com/uvm-guide-for-beginners/
2. https://github.com/naragece/uvm-testbench-tutorial-simple-adder
3. http://accellera.org/downloads/standards/uvm
3. https://verificationacademy.com/cookbook/questa/compilinguvm
4. https://blogs.mentor.com/verificationhorizons/blog/2011/03/08/using-the-uvm-10-release-with-questa/
4. http://chanrui.blogspot.com/2012/03/verdi-and-vcs-cosim.html
5. http://www.cnblogs.com/lunix/archive/2011/03/20/vcs_and_verdi_cosim.html
6. https://github.com/hjking/mydotfiles/blob/master/vim/vim_wiki/eda/verdi/Linking_And_Dumping.wiki

Friday, January 20, 2017

Rule Violation (RTSTAT-6) Partial Conflict issue on Vivado rev 2015.4

For Vivado 2015.4, I hit an error like the following when click "Generate Bitstream" after implementation is done.
ERROR: [DRC 23-20] Rule violation (RTSTAT-6) Partial Conflict - 18640 net(s) have a partial conflict. The problem bus(es) and/or net(s) are .....

The errors occured when I use the implemenation strategy of "Vivado Implementation Defaults". Also tried "Performance_Explore", it does not help. It is found that when I try the implementation strategy of "Area_Explore", the RTSTAT-6 disappeared and bitstream can be generated successfully after implementation.

Monday, January 9, 2017

Using Synplify and Vivado

Use Synopsys's Synplify to do synthesize and then use Xilinx Vivado to complete implementation. Ref[1] is an article on this.

References
---------------
1. Vivado Implementation 1, http://blog.chinaaet.com/huberyli/p/160952

Tuesday, August 30, 2016

Difference between Questasim and Modelsim

Used Questasim and Modelsim before. The former is commercial  and the latter is a bit old and can get educational version free. Found the differences of these two tools below from Ref[1].

Questa is Mentor's flagship product that has full System Verilog simulation support. Modelsim is an older product that has limited support for System Verilog. If you plan on using OVM/UVM then you would want to go with Questa, otherwise Modelsim is good enough.

From the following product description pages it looks like Questa's simulation kernel was written to take advantage of multi-core processors, and should have higher performance for large designs. I've never had the opportunity to use Questa for any extended period of time as the places I've worked never wanted to fork over the premium cost over a Modelsim license to get Questa.

Modelsim Product page:
http://www.mentor.com/products/fv/modelsim/

Questa Product page
http://www.mentor.com/products/fv/questa/

Some of the key differences of Questa over ModelSim:
    Compile flow optimizations
    Simulation Performance optimizations (2-50X)
    Post processing analysis (i.e. run a simulation in batch while viewing the results of a previous simulation)
    Multiple Wave Windows
    64-bit mode support (ModelSim is only released to run in 32-bit mode)
    Links to analog/mixed-signal simulation
    Job control and Integration with Simulation farms
    Access to Advanced SystemVerilog Testbench features (assertions, constraints, functional coverage)

References
------------
1. http://www.edaboard.com/thread195003.html

Saturday, August 20, 2016

FPGA design step by step using Zed board 1 - A simple project to use SW0 to control LED0

Lets start with a simplest example to use switch 0 to control LED 0 using Zedboard.

1. Create a new project of led_ctrl using vivado.

2. Find the SW0 and LD0 in master xdc file of Zedboard and create a constraint file accordingly below. And add the constraint to the project

# ----------------------------------------------------------------------------
# User LEDs - Bank 33
# ---------------------------------------------------------------------------- 
set_property PACKAGE_PIN T22 [get_ports {LD0}];  # "LD0"


# ----------------------------------------------------------------------------
# User DIP Switches - Bank 35
# ---------------------------------------------------------------------------- 
set_property PACKAGE_PIN F22 [get_ports {SW0}];  # "SW0"

set_property IOSTANDARD LVCMOS33 [get_ports {LD0}]
set_property IOSTANDARD LVCMOS33 [get_ports {SW0}]

The master xdc file for Zedboard can be downloaded at Ref[1]

3. Create a simple verilog file of led_ctrl.v with contents below and added to the project.

`timescale 1ns / 1ps
//led_ctrl.v

module led_ctrl(
       input wire SW0,
       output wire LD0
    );

assign LD0 = SW0;

endmodule

4. Run synthesis and implementation and generate bit file.
5. Download the bitfile to Zedboard.

After that, we can change SW0 positions to turn on and off LED0.

References
--------------
1. master XDC file for Zedboard,  http://zedboard.org/sites/default/files/documentations/zedboard_master_XDC_RevC_D_v3.zip