Modelsim Vhdl library lpm not found.

OP #2643426
Rate this post
• ▲ useful
▼ not useful
Here is the code i want to simulate :

LIBRARY lpm;
USE lpm.lpm_components.ALL;

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;

PACKAGE mul_package is -- user defined components
  COMPONENT ccmul
    GENERIC (W2 : INTEGER := 17; --multiplier bit width
              W1 : INTEGER := 9; --bit width C+S SUM
              W   : INTEGER := 8); -- Input bit width

              PORT
              (clk : IN STD_LOGIC; -- clock for the output register
              x_in, y_in, c_in : IN STD_LOGIC_VECTOR(W-1 DOWNTO 0);
              --INPUTS
              cps_in, cms_in : IN STD_LOGIC_VECTOR(W-1 DOWNTO 0);
              --INPUTS
              r_out, i_out : OUT STD_LOGIC_VECTOR(W-1 DOWNTO 0));
              --RESULTS
            END COMPONENT;
          END mul_package;

LIBRARY work;
USE work.mul_package.ALL;

LIBRARY ieee;
USE ieee.std-logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
LIBRARY lpm;
USE lpm.lpm_components.ALL;

LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.std_logic_arith.ALL;
USE ieee.std_logic_unsigned.ALL;

ENTITY bfproc IS
  GENERIC ( W2 : INTEGER := 17;  --multiplier bit width
  W1 : INTEGER := 9;
  W : INTEGER := 8);
  PORT
  (clk    :STD_LOGIC;
  Are_in, Aim_in, c_in, --8 bit inputs
  Bre_in, Bim_in : IN STD_LOGIC_VECTOR(W-1 DOWNTO 0);
  cps_in, cms_in : IN STD_LOGIC_VECTOR(W1-1 DOWNTO 0); --9 bits 
coefficients

  Dre_out, Dim_out, --8bit results
  Ere_out , Eim_out : OUT STD_LOGIC_VECTOR(W1 DOWNTO 0));
END bfproc;

ARCHITECTURE flex OF bfproc IS
  SIGNAL dif_re, dif_im         --Bf out
  : STD_LOGIC_VECTOR(W-1 DOWNTO 0);
  SIGNAL Are, Aim, Bre, Bim : integer RANGE -128 TO 127;
  --inputs as integers
  SIGNAL c : STD_LOGIC_VECTOR(W-1 DOWNTO 0);
  --input
  SIGNAL cps, cms : STD_LOGIC_VECTOR(W1 DOWNTO 0);
  --RESULTS

BEGIN
  PROCESS --compute the additions of the butterfly using
    BEGIN -- integers and store inputs in flip flops
      WAIT UNTIL clk = '1';
      Are <= CONV_INTEGER (Are_in);
      Aim <= CONV_INTEGER(Aim_in);
      Bre <= CONV_INTEGER(Bre_in);
      Bim <= CONV_INTEGER(Bim_in);
      c <= c_in; --load from memory cos
      cps <= cps_in; --load from memory cos+sin
      cms <= cms_in; --Load from memory cos-sin
      Dre_out <= CONV_STD_LOGIC VECTOR (Are + Bre )/2, W);
      Dim_out <= CONV_STD_LOGIC_VECTOR(Aim + Bim)/2, W);
    END PROCESS;

    --No FF because butterfly difference ''diff'' is not an output port

    PROCESS (Are, Bre, Aim, Bim)
      BEGIN
        dif_re <= CONV_STD_LOGIC_VECTOR(Are/2 - Bre/2, 8);
        dif_im <= CONV_STD_LOGIC_VECTOR(Aim/2 - Bim/2,8);
      END PROCESS;
Guest #5576650
Rate this post
• ▲ useful
▼ not useful
Just for completeness, here is a kind of compxlib for Altera. Stratix 
IV (Makefile):
1
.ONESHELL:
2
.SILENT:
3

4
QUARTUS_PATH = ..
5
COMPILED_PATH = compiled_libs
6
FLAGS =  -93  -quiet
7
VFLAGS = -vlog01compat  -quiet
8

9
all: clean build_verilog build_vhdl
10

11
build_verilog:
12
  cd compiled_libs
13
  vlib altera_ver
14
  vlib sgate_ver
15
  vlib lpm_ver
16
  vlib altera_mf_ver
17
  vlib stratixiv_ver
18
  
19
  vmap altera_ver       ${COMPILED_PATH}/altera_ver
20
  vmap sgate_ver        ${COMPILED_PATH}/sgate_ver
21
  vmap lpm_ver          ${COMPILED_PATH}/lpm_ver
22
  vmap altera_mf_ver    ${COMPILED_PATH}/altera_mf_ver
23
  vmap stratixiv_ver    ${COMPILED_PATH}/stratixiv_ver
24

25
  vlog  ${VFLAGS} -work altera_ver    ${QUARTUS_PATH}/sim_lib/altera_primitives.v
26
  vlog  ${VFLAGS} -work sgate_ver     ${QUARTUS_PATH}/sim_lib/sgate.v
27
  vlog  ${VFLAGS} -work lpm_ver       ${QUARTUS_PATH}/sim_lib/220model.v
28
  vlog  ${VFLAGS} -work altera_mf_ver ${QUARTUS_PATH}/sim_lib/altera_mf.v
29
  vlog  ${VFLAGS} -work stratixiv_ver ${QUARTUS_PATH}/sim_lib/stratixiv_atoms.v
30

31

32
build_vhdl:  
33
  cd compiled_libs
34
  vlib altera
35
  vlib lpm
36
  vlib stratixiv
37

38
  vmap altera       ${COMPILED_PATH}/altera
39
  vmap lpm          ${COMPILED_PATH}/lpm
40
  vmap stratixiv    ${COMPILED_PATH}/stratixiv
41
  
42
  vcom ${FLAGS} -work  altera ${QUARTUS_PATH}/sim_lib/altera_primitives_components.vhd
43
  vcom ${FLAGS} -work  altera ${QUARTUS_PATH}/sim_lib/altera_primitives.vhd
44

45
  #vcom ${FLAGS} -work  lpm ${QUARTUS_PATH}/fv_lib/vhdl/lpms/lpm_components.vhd
46
  #vcom ${FLAGS} -work  lpm ${QUARTUS_PATH}/fv_lib/vhdl/lpms/lpm_and.vhd
47
  #vcom ${FLAGS} -work  lpm ${QUARTUS_PATH}/fv_lib/vhdl/lpms/lpm_mux.vhd
48
  #vcom ${FLAGS} -work  lpm ${QUARTUS_PATH}/fv_lib/vhdl/lpms/lpm_or.vhd
49
  #vcom ${FLAGS} -work  lpm ${QUARTUS_PATH}/fv_lib/vhdl/lpms/lpm_xor.vhd
50

51
  vcom ${FLAGS} -work  stratixiv ${QUARTUS_PATH}/fv_lib/vhdl/stratixiv/stratixiv_components.vhd
52
  vcom ${FLAGS} -work  stratixiv ${QUARTUS_PATH}/sim_lib/stratixiv_atoms.vhd
53
  vcom ${FLAGS} -work  stratixiv ${QUARTUS_PATH}/sim_lib/stratixiv_components.vhd
54
  
55
  
56
clean:
57
  /bin/rm -rf  altera
58
  /bin/rm -rf  lpm
59
  /bin/rm -rf  stratixiv
60
  
61
  /bin/rm -rf altera_ver
62
  /bin/rm -rf lpm_ver
63
  /bin/rm -rf sgate_ver
64
  /bin/rm -rf altera_mf_ver
65
  /bin/rm -rf stratixiv_ver

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.