K
Kashif
Guest
Hello all
I have problem in the following code while updating the output
(clk_reg) in my second process
I am assigning temp_reg (Signal ) to clk_reg (to final output) but the
output is 0 or UNsigned (U) ... However the signal temp_reg is having
correct output.
Please help me out .....regarding this
Library IEEE;
use IEEE.std_logic_1164.ALL;
use IEEE.std_logic_signed.ALL;
entity Power_reg is
port (
clk, rst : in std_logic;
sys_clk : in std_logic;
core_power_reg : in std_logic_vector(8 downto 0);
core_clock_reg : in std_logic_vector(8 downto 0);
proc_power_bit : in std_logic;
proc_clk_bit : in std_logic;
power_reg : out std_logic_vector(9 downto 0);
clk_reg : out std_logic_vector(9 downto 0)
);
end Power_reg;
--}} End of automatically maintained section
architecture rtl_power_reg of Power_reg is
signal Sys_clk_reg : std_logic_vector (9 downto 0);
signal temp_reg : std_logic_vector(9 downto 0);
signal power_tmp_reg : std_logic_vector(9 downto 0);
signal clk_tmp_reg :std_logic_vector(9 downto 0);
begin
-- Sequential process
process(clk,rst,power_tmp_reg,Sys_clk_reg, temp_reg)
begin
if rst = '0' then
power_reg <= (others => '0');
clk_reg <= (others => '0');
elsif clk'event AND clk='1' then
power_reg <= power_tmp_reg;
end if ;
end process;
-- Combinational Process
process(proc_clk_bit, core_clock_reg, sys_clk, proc_power_bit,
core_power_reg)
begin
-- replicate /copy sys_clk to 10 bit register
Sys_clk_reg <= (sys_clk & sys_clk & sys_clk & sys_clk & sys_clk &
sys_clk & sys_clk & sys_clk & sys_clk & sys_clk);
power_tmp_reg <= proc_power_bit & core_power_reg;
temp_reg <= NOT(proc_clk_bit & core_clock_reg);
clk_tmp_reg(0) <= Sys_clk_reg(0) AND temp_reg(0);
clk_tmp_reg(1) <= Sys_clk_reg(1) AND temp_reg(1);
clk_tmp_reg(2) <= Sys_clk_reg(2) AND temp_reg(2);
clk_tmp_reg(3) <= Sys_clk_reg(3) AND temp_reg(3);
clk_tmp_reg(4) <= Sys_clk_reg(4) AND temp_reg(4);
clk_tmp_reg(5) <= Sys_clk_reg(5) AND temp_reg(5);
clk_tmp_reg(6) <= Sys_clk_reg(6) AND temp_reg(6);
clk_tmp_reg(7) <= Sys_clk_reg(7) AND temp_reg(7);
clk_tmp_reg(8) <= Sys_clk_reg(8) AND temp_reg(8);
clk_tmp_reg(9) <= Sys_clk_reg(9) AND temp_reg(9);
-- Problem with following output
clk_reg <= clk_tmp_reg;
end process;
end rtl_power_reg;
I have problem in the following code while updating the output
(clk_reg) in my second process
I am assigning temp_reg (Signal ) to clk_reg (to final output) but the
output is 0 or UNsigned (U) ... However the signal temp_reg is having
correct output.
Please help me out .....regarding this
Library IEEE;
use IEEE.std_logic_1164.ALL;
use IEEE.std_logic_signed.ALL;
entity Power_reg is
port (
clk, rst : in std_logic;
sys_clk : in std_logic;
core_power_reg : in std_logic_vector(8 downto 0);
core_clock_reg : in std_logic_vector(8 downto 0);
proc_power_bit : in std_logic;
proc_clk_bit : in std_logic;
power_reg : out std_logic_vector(9 downto 0);
clk_reg : out std_logic_vector(9 downto 0)
);
end Power_reg;
--}} End of automatically maintained section
architecture rtl_power_reg of Power_reg is
signal Sys_clk_reg : std_logic_vector (9 downto 0);
signal temp_reg : std_logic_vector(9 downto 0);
signal power_tmp_reg : std_logic_vector(9 downto 0);
signal clk_tmp_reg :std_logic_vector(9 downto 0);
begin
-- Sequential process
process(clk,rst,power_tmp_reg,Sys_clk_reg, temp_reg)
begin
if rst = '0' then
power_reg <= (others => '0');
clk_reg <= (others => '0');
elsif clk'event AND clk='1' then
power_reg <= power_tmp_reg;
end if ;
end process;
-- Combinational Process
process(proc_clk_bit, core_clock_reg, sys_clk, proc_power_bit,
core_power_reg)
begin
-- replicate /copy sys_clk to 10 bit register
Sys_clk_reg <= (sys_clk & sys_clk & sys_clk & sys_clk & sys_clk &
sys_clk & sys_clk & sys_clk & sys_clk & sys_clk);
power_tmp_reg <= proc_power_bit & core_power_reg;
temp_reg <= NOT(proc_clk_bit & core_clock_reg);
clk_tmp_reg(0) <= Sys_clk_reg(0) AND temp_reg(0);
clk_tmp_reg(1) <= Sys_clk_reg(1) AND temp_reg(1);
clk_tmp_reg(2) <= Sys_clk_reg(2) AND temp_reg(2);
clk_tmp_reg(3) <= Sys_clk_reg(3) AND temp_reg(3);
clk_tmp_reg(4) <= Sys_clk_reg(4) AND temp_reg(4);
clk_tmp_reg(5) <= Sys_clk_reg(5) AND temp_reg(5);
clk_tmp_reg(6) <= Sys_clk_reg(6) AND temp_reg(6);
clk_tmp_reg(7) <= Sys_clk_reg(7) AND temp_reg(7);
clk_tmp_reg(8) <= Sys_clk_reg(8) AND temp_reg(8);
clk_tmp_reg(9) <= Sys_clk_reg(9) AND temp_reg(9);
-- Problem with following output
clk_reg <= clk_tmp_reg;
end process;
end rtl_power_reg;