Mixed verilog and vhdl compilation with VCS

Here I will explain how you can compile and simulate vhdl and verlog based design using the VCS. lets take a small example of counter. The dut will be written in vhdl and the testbench we will write in verilog. Then we will instantiate vhdl counter into our verilog testbench and then compile and simulate it.

Here is the code for dut and testbench.

VHDL DUT :
==========

library ieee ;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity counter is
port(  clk:  in std_logic;
  reset:  in std_logic;
  enable:  in std_logic;
  count:  out std_logic_vector(3 downto 0)
);
end counter;

architecture behav of counter is
  signal pre_count: std_logic_vector(3 downto 0);
  begin
    process(clk, enable, reset)
    begin
      if reset = '1' then
        pre_count <= "0000";
      elsif (clk='1' and clk'event) then
        if enable = '1' then
          pre_count <= pre_count + "1";
        end if;
      end if;
    end process;
    count <= pre_count;
end behav;

Verilog Testbench
=================

module counterTb;
    reg clk;
    reg reset;
    reg enable;
    wire [3:0] count;

    initial
    begin
        $monitor ($time, " Count = %d", count);
        clk=0;
        reset = 1;
        enable = 0;
        #5
        reset = 0;
        enable = 1;
    end

    initial
        forever
            #5 clk = ~clk;

    initial
        #1000 $finish;

   // initialize vhdl counter module
   counter (.clk(clk),.reset(reset),.enable(enable), .count(count));

endmodule

Steps to compile :
* Create directory for the compiled libraries (mkdir compile)

* Setup “synopsys_sim.setup” file and map libraries in it

  • Create file synoosys_sim.setup
  • Add line : counter_lib : ./compile/

* Compile the libraries

  • vhdlan -work counter_lib counter.vhdl
  • vlogan +v2k +incdir+./ -work counter_lib countertb.v

* Elobrate the design and generate executable

  • vcs counter_lib.counterTb

* Simulate it.

  • ./simv

You can create a makefile also to design and elobrate the design. Something like

all : compile sim

counter_lib : counter.vhdl
    vhdlan -work counter_lib counter.vhdl

countertb_lib : countertb.v
    vlogan +v2k +incdir+./  -work counter_lib countertb.v

compile : countertb_lib counter_lib

sim :
    vcs counter_lib.counterTb

Now you just need to say “make”. It will compile and elobrate the design.

synopsys_sim.setup file content
===============================

counter_lib : ./compile/
WORK>DEFAULT
DEFAULT: ./compile/
ASSERT_IGNORE_WARNING=TRUE
ASSERT_IGNORE_FAILURE=TRUE
ASSERT_IGNORE_ERROR=TRUE

Tags: , , ,

68 Responses to “Mixed verilog and vhdl compilation with VCS”

  1. SHAWN says:


    Medicamentspot.com. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Best quality drugs. High quality drugs. Order pills online

    Buy:Viagra Super Active+.Viagra Professional.Cialis Super Active+.Tramadol.Propecia.Levitra.Viagra Super Force.Cialis Soft Tabs.Viagra Soft Tabs.Cialis.Zithromax.Soma.Super Active ED Pack.Viagra.Cialis Professional.VPXL.Maxaman….

  2. ZACHARY says:


    CheapTabletsOnline.com. Canadian Health&Care.Special Internet Prices.Best quality drugs.No prescription online pharmacy. Online Pharmacy. Order pills online

    Buy:Soma.Viagra Professional.Viagra Super Force.VPXL.Viagra.Maxaman.Propecia.Viagra Super Active+.Levitra.Super Active ED Pack.Cialis Super Active+.Cialis Soft Tabs.Cialis.Zithromax.Viagra Soft Tabs.Tramadol.Cialis Professional….

  3. JESUS says:


    NEW FASHION store. Original designers collection at low prices!!! 20 % TO 70 % OFF. END OF SEASON SALE!!!

    BUY FASHION. TOP BRANDS: GUCCI, DOLCE&GABBANA, BURBERRY, DIESEL, ICEBERG, ROBERTO CAVALLI, EMPORIO ARMANI, VERSACE…

  4. ANTHONY says:

    rxlist@abilify.now” rel=”nofollow”>..

    Buydrugs without prescription…

  5. Alexander6 says:

    buy@generic.VIAGRA” rel=”nofollow”>…

    Need cheap generic VIAGRA?…

  6. ANGEL says:

    Order@Coral.Calcium.Online” rel=”nofollow”>..

    Buygeneric pills…

  7. BRANDON says:

    pictures@of.abilify” rel=”nofollow”>..

    Buyno prescription…

  8. LEWIS says:

    Order@Abilify.Without.Prescription” rel=”nofollow”>..

    Buynow it…

  9. DUSTIN says:

    Cheap@Generic.Abilify” rel=”nofollow”>..

    Buygeneric drugs…

  10. EDUARDO says:

    Cheap@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..

    Buygeneric pills…

  11. RICARDO says:

    Buy@Cheap.Acai” rel=”nofollow”>..

    Buydrugs without prescription…

  12. SALVADOR says:

    Cheap@Acai.Online” rel=”nofollow”>…

    Buynow…

  13. PERRY says:

    Get@Coral.Calcium.Online” rel=”nofollow”>…

    Buywithout prescription…

  14. ENRIQUE says:

    Order@Cheap.Abana” rel=”nofollow”>.

    Buynow it…

  15. TERRENCE says:

    ..

    Buyit now…

  16. SALVADOR says:

    Order@Generic.Abilify” rel=”nofollow”>..

    Buygeneric meds…

  17. RALPH says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  18. SAMUEL says:

    Buy@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  19. FELIX says:

    Order@Acai.Online” rel=”nofollow”>…

    Buyit now…

  20. JEFFREY says:

    Purchase@Acai.Online” rel=”nofollow”>…

    Buynow it…

  21. DONALD says:

    Purchase@Cheap.Acai” rel=”nofollow”>…

    Buyit now…

  22. WALLACE says:

    Purchase@Cheap.Acai” rel=”nofollow”>…

    Buygeneric drugs…

  23. RUSSELL says:

    Purchase@Cheap.Acai” rel=”nofollow”>..

    Buywithout prescription…

  24. TERRENCE says:

    Buy@Cheap.Energy.Boost” rel=”nofollow”>.…

    Buygeneric drugs…

  25. NATHAN says:

    Order@Discount.Energy.Boost” rel=”nofollow”>.…

    Buynow it…

  26. ADAM says:

    Buy@Discount.Accupril” rel=”nofollow”>.…

    Buyno prescription…

  27. BRUCE says:

    Order@Cheap.Accutane” rel=”nofollow”>.…

    Buygeneric drugs…

  28. SAM says:

    Purchase@Accutane.Online” rel=”nofollow”>.…

    Buynow it…

  29. TED says:

    Cheap@Generic.Accutane.10mg.20mg” rel=”nofollow”>.…

    Buyno prescription…

  30. ANGELO says:

    Cheap@Aciphex.Online” rel=”nofollow”>.…

    Buynow it…

  31. BILLY says:

    Purchase@Generic.Aciphex” rel=”nofollow”>.…

    Buygeneric drugs…

  32. ANDREW says:

    Cheap@Aciphex.Without.Prescription” rel=”nofollow”>.…

    Buynow it…

  33. RUBEN says:

    Order@Acomplia.Online” rel=”nofollow”>.…

    Buygeneric meds…

  34. BOB says:

    Order@Discount.Acomplia” rel=”nofollow”>.…

    Buygeneric drugs…

  35. SERGIO says:

    Buy@Actos.Without.Prescription” rel=”nofollow”>.

    Buyno prescription luw…

  36. DARYL says:

    Purchase@Actos.Without.Prescription” rel=”nofollow”>..

    Buygeneric drugs krg…

  37. VICTOR says:

    Buy@Acular.Online” rel=”nofollow”>..

    Buygeneric pills zdg…

  38. RAY says:

    Cheap@Acular.Online” rel=”nofollow”>.

    Buygeneric drugs zfk…

  39. MARCUS says:

    Order@Discount.Abana” rel=”nofollow”>..

    Buynow it vhx…

  40. JEREMIAH says:

    Cheap@Abana.Online” rel=”nofollow”>..

    Buynow it tly…

  41. MARION says:

    Order@Cheap.Acai” rel=”nofollow”>..

    Buyno prescription gdt…

  42. BRUCE says:

    Get@Acai.Online” rel=”nofollow”>…

    Buynow it zdg…

  43. JOEL says:

    Generic@Acai.500mg.Without.Prescription” rel=”nofollow”>..

    Buyno prescription wkp…

  44. AUSTIN says:

    Order@Cheap.Accupril” rel=”nofollow”>.

    Buynow it fnp…

  45. LEROY says:

    Order@Accutane.Online” rel=”nofollow”>…

    Buyit now sge…

  46. MARION says:

    Order@Discount.Accutane” rel=”nofollow”>.

    Buygeneric drugs mby…

  47. JASON says:

    Purchase@Cheap.Accutane” rel=”nofollow”>…

    Buywithout prescription ccw…

  48. RONALD says:

    Buy@Aciphex.Online” rel=”nofollow”>.

    Buygeneric drugs itj…

  49. LEWIS says:

    Purchase@Cheap.Aciphex” rel=”nofollow”>.

    Buygeneric drugs axm…

  50. VINCENT says:

    Purchase@Aciphex.Without.Prescription” rel=”nofollow”>.

    Buydrugs without prescription xab…

Leave a Reply