Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Identifier "m" is not directly visible.how to clear the error???

Status
Not open for further replies.

eddie vasanth

Newbie level 2
Newbie level 2
Joined
Feb 15, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,300
hi,
i am getting the following error while i compiling vhdl prog in modelsim.i cant understand what type of error and how to change since i am starter of vhdl..so pls help me out this prob..

here is error i m getting...

1. Identifier "m" is not directly visible.
Potentially visible declarations are:
work.real2bit.m (constant)
work.constants.m (constant)
2.Bad expression in right operand of infix expression "mod".
** Error: F:\Edwin\BPSk project\codings\bps.vhd(37): Bad right hand side (infix expression) in variable assignment.
** Error: F:\Edwin\BPSk project\codings\bps.vhd(43): (vcom-1078) Identifier "m" is not directly visible.

3.Bad expression in left operand of infix expression "-".
** Error: F:\Edwin\BPSk project\codings\bps.vhd(21): Bad expression in right bound of range expression.
** Error: F:\Edwin\BPSk project\codings\bps.vhd(21): Type error in range expression.
** Error: F:\Edwin\BPSk project\codings\bps.vhd(37): (vcom-1078) Identifier "m" is not directly visible.

here it is prog which i need to change

Code:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use work.constants.all;
use work.real2bit.all;
entity bpsk is
Port ( clk : in STD_LOGIC;
reset : in STD_LOGIC;
serial_data : in STD_LOGIC;
clk_data : out STD_LOGIC;
clk_spi : out STD_LOGIC;
clk_bpsk : out STD_LOGIC;
data : out STD_LOGIC_VECTOR (11 downto 0));
end bpsk;
architecture Behavioral of bpsk is
signal pointer : natural range 0 to (M-1) := M-1;
signal value : word := (others => '0');
signal clk_bpsk : std_logic := '0';
begin
process(reset,clk,clk_bpsk)
variable count : natural range 0 to (64*M-1) := 0;
begin
if reset = '1' then
clk_bpsk <= '0';
clk_data <= '0';
count := 0;
elsif clk'event and clk = '1' then
if count = 0 then
clk_bpsk <= '1';
clk_data <= '1';
elsif count mod 64 = 0 then
clk_bpsk <= '1';
else
clk_bpsk <= '0';
clk_data <= '0';
end if;
count := (count + 1) mod (64*M);
end if;
end process;
process(reset,clk_bpsk)
    begin
if reset = '1' then
pointer <= M-1;
elsif clk_bpsk'event and clk_bpsk = '1' then
pointer <= (pointer + 1) mod M;
end if;
end process;
clk_spi <= clk;
value <= -table_wave(pointer) when serial_data = '1' else table_wave(pointer);
-- Use the next line for simulation
data <= std_logic_vector(value);
-- Use the next line for synthesis and comment the previous one
--data <= value + conv_signed(2**(nbits-1),nbits);
clk_bpsk <= clk_bpsk;
end Behavioral;
 
Last edited by a moderator:

hi,
i am getting the following error while i compiling vhdl prog in modelsim.i cant understand what type of error and how to change since i am starter of vhdl..so pls help me out this prob..

here is error i m getting...

1. Identifier "m" is not directly visible.
Potentially visible declarations are:
work.real2bit.m (constant)
work.constants.m (constant)
2.Bad expression in right operand of infix expression "mod".
** Error: F:\Edwin\BPSk project\codings\bps.vhd(37): Bad right hand side (infix expression) in variable assignment.
** Error: F:\Edwin\BPSk project\codings\bps.vhd(43): (vcom-1078) Identifier "m" is not directly visible.

3.Bad expression in left operand of infix expression "-".
** Error: F:\Edwin\BPSk project\codings\bps.vhd(21): Bad expression in right bound of range expression.
** Error: F:\Edwin\BPSk project\codings\bps.vhd(21): Type error in range expression.
** Error: F:\Edwin\BPSk project\codings\bps.vhd(37): (vcom-1078) Identifier "m" is not directly visible.

You have two constants both called 'm' that are visible and can be used, the compiler can't determine from the usage context which one should be used, hence the error. It calls out the two possibilities
work.real2bit.m
work.constants.m

You will need to decide which one is correct and make a change like this...
Original: count := (count + 1) mod (64*M);
Modified: count := (count + 1) mod (64*work.constants.M);

The other errors you'll have to find on your own, I'm not going to try to figure out where 'line 21' is.

Kevin Jennings
 
thanks kevin...its worked i got output....one more help sir...i m developing another project in pipelined FFT in this i developed codings but dont knw how to give input in which simulation window input format {-1e+308}{-1e+308}..how to give input sir???i ve given lik{2 -1}..but i ding get output...help me..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top