O
Olaf
Guest
Hi,
there are some problems accumulated on this weekend, sorry
Well, I have to following peace of code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity stage is
port(
...
set_config : in std_ulogic;
data : in std_ulogic_vector(31 downto 0);
...
end entity;
-------------------------------------------------------------------------------
architecture behavioral of trigger_stage is
signal rg_timer : std_ulogic_vector(15 downto 0);
signal rg_level : std_ulogic_vector(7 downto 0);
signal rg_combine : std_ulogic_vector(1 downto 0);
...
begin
-- vcom complains if a signal is missing
configure: process (conf_clk, reset, set_config, set_bit_mask,
set_bit_value, set_edge_mask, set_fe_mask,
set_re_mask, data)
is
-------------------------------------------------------------------------
variable set : std_ulogic_vector(5 downto 0);
variable n : positive;
-------------------------------------------------------------------------
function to_onehot (signal level : natural)
return std_ulogic_vector
is
variable tmp : unsigned(8 downto 0)
:= (0 => '1', others => '0');
begin
tmp := tmp sll level;
return std_ulogic_vector(tmp(8 downto 1));
end function;
------------------------------------------------------
begin
set := set_bit_value &
set_bit_mask &
set_re_mask &
set_fe_mask &
set_edge_mask &
set_config;
if (reset = RESET_ACTIVE) then
...
elsif rising_edge(conf_clk) then
case set is
...
when b"000001" =>
rg_timer <= data(31 downto 16);
n := to_integer(unsigned(data(7 downto 4)));
rg_level <= to_onehot; -- ERROR
rg_combine <= data(1 downto 0);
when others => null;
end case;
end if;
end process;
...
The goal is to demux an integer bitfield data(7 downto 4) into a
"one-hot" sulv. I've got the error:
Actual (variable "n") for formal "level" is not a signal.
Do I have really to introduce an extra signal or is there another way?
The goal is to compare the register rg_level with a "counter" value of
an other process, which shifts the '1' on rising edge pending on some
other hit conditions. On compare match further actions are performed.
Thanks
Olaf
there are some problems accumulated on this weekend, sorry
Well, I have to following peace of code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity stage is
port(
...
set_config : in std_ulogic;
data : in std_ulogic_vector(31 downto 0);
...
end entity;
-------------------------------------------------------------------------------
architecture behavioral of trigger_stage is
signal rg_timer : std_ulogic_vector(15 downto 0);
signal rg_level : std_ulogic_vector(7 downto 0);
signal rg_combine : std_ulogic_vector(1 downto 0);
...
begin
-- vcom complains if a signal is missing
configure: process (conf_clk, reset, set_config, set_bit_mask,
set_bit_value, set_edge_mask, set_fe_mask,
set_re_mask, data)
is
-------------------------------------------------------------------------
variable set : std_ulogic_vector(5 downto 0);
variable n : positive;
-------------------------------------------------------------------------
function to_onehot (signal level : natural)
return std_ulogic_vector
is
variable tmp : unsigned(8 downto 0)
:= (0 => '1', others => '0');
begin
tmp := tmp sll level;
return std_ulogic_vector(tmp(8 downto 1));
end function;
------------------------------------------------------
begin
set := set_bit_value &
set_bit_mask &
set_re_mask &
set_fe_mask &
set_edge_mask &
set_config;
if (reset = RESET_ACTIVE) then
...
elsif rising_edge(conf_clk) then
case set is
...
when b"000001" =>
rg_timer <= data(31 downto 16);
n := to_integer(unsigned(data(7 downto 4)));
rg_level <= to_onehot; -- ERROR
rg_combine <= data(1 downto 0);
when others => null;
end case;
end if;
end process;
...
The goal is to demux an integer bitfield data(7 downto 4) into a
"one-hot" sulv. I've got the error:
Actual (variable "n") for formal "level" is not a signal.
Do I have really to introduce an extra signal or is there another way?
The goal is to compare the register rg_level with a "counter" value of
an other process, which shifts the '1' on rising edge pending on some
other hit conditions. On compare match further actions are performed.
Thanks
Olaf