Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

The Problem when simulate the lpm_ff using ModelSim-Altera

I am a new learner for ModelSim, and I have met some problems about it.

I have made a simple dff using lpm_ff, the code is showed below

module fddf(clk,clear,q);

input clk,

clear;

output q;

lpm_ff f1(.enable(1'b1),.clock(clk),.sclr(1'b0),.data(clear),.q(q));

defparam f1.lpm_width=1,

f1.lpm_fftype = "dff";

endmoduleand I have write test bench for it, the code is showed below

`timescale 1 ps/ 1 ps

module fddf_vlg_tst();

// constants

// general purpose registers

reg eachvec;

// test vector input registers

reg clear;

reg clk;

// wires

wire q;

// assign statements (if any)

fddf i1 (

// port map - connection between master ports and signals/registers

.clear(clear),

.clk(clk),

.q(q)

);

initial

begin

// code that executes only once

// insert code here --> begin

clk=0;

clear=0;

// --> end

$display("running testbench");

end

always # 25 clk = ~clk ;

endmodule

But when I use ModelSim-Altera to simulate it, such error comes out:

error: (vsim-10000) c:/users/tei.ylib_tei-pc/desktop/dff3/fddf.v(10): unresolved defparam reference to 'lpm_width' in f1.lpm_width.

error: (vsim-10000) c:/users/tei.ylib_tei-pc/desktop/dff3/fddf.v(11): unresolved defparam reference to 'lpm_fftype' in f1.lpm_fftype.

The file I added to the ModelSim-Altera project is the design file and testbech file, also, the 220model.v and altera_mf.v, cycloneiii_atoms.v are included.

I am quiet confused about how to simulate the lpm parts, please help me , Thanks.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I am sorry the problem solved. Use lpm_ff#(1) f1.(.....) can solve the problem.