A
a_Conan
Guest
Hi,
Suppose I have this code:
---------------------------------------
Function func_rt(
a : std_logic_vector(7 downto 0);
b : std_logic_vector(7 downto 0);
c : integer) return std_logic is
variable res : std_logic;
begin
res := a(c) and b(c)
return res;
end func_rt;
------------------------------------
----- main
..
..
Port( clock : in std_logic;
Rm : out std_logic)
..
..
Constant k1 : std_logic_vector(7 downto 0) := "10111010";
Constant k2 : std_logic_vector(7 downto 0) := "01111101";
..
..
Signal g : std_logic_vector(7 downto 0) : k1;
Signal f : std_logic_vector(7 downto 0) : k2;
Signal result : std_logic;
Signal ready : std_logic := '0';
Begin
Process(clock)
Begin
If(clock'event and clock = '1') then
If(Ready ='0') then
Result <= func_rt(g, f, 3);
Ready <= '1';
Else
Rm <= Result;
End if;
End process;
End program_behav;
-----------------------------
The problem when I run the program the upper code in the simulator can
give the result of signal 'Rm' = '1' very good. But when I use the
Quartus II syntheses tool to synthesize on the cyclone FPGA and I
assign the 'Rm' to the result the specific led gives nothing.
I think my problem that the next cycle of the process 'Result signal'
will be assigned to nothing, the Rm <= Result will get 'U' or 'Zero'.
Or anything.
The question is there any way to save the result of line:
Result <= func_rt(g, f, 3);
For infinity time, so I can use the Result Signal with newest value
anytime when the Ready signal became '1' .
Suppose I have this code:
---------------------------------------
Function func_rt(
a : std_logic_vector(7 downto 0);
b : std_logic_vector(7 downto 0);
c : integer) return std_logic is
variable res : std_logic;
begin
res := a(c) and b(c)
return res;
end func_rt;
------------------------------------
----- main
..
..
Port( clock : in std_logic;
Rm : out std_logic)
..
..
Constant k1 : std_logic_vector(7 downto 0) := "10111010";
Constant k2 : std_logic_vector(7 downto 0) := "01111101";
..
..
Signal g : std_logic_vector(7 downto 0) : k1;
Signal f : std_logic_vector(7 downto 0) : k2;
Signal result : std_logic;
Signal ready : std_logic := '0';
Begin
Process(clock)
Begin
If(clock'event and clock = '1') then
If(Ready ='0') then
Result <= func_rt(g, f, 3);
Ready <= '1';
Else
Rm <= Result;
End if;
End process;
End program_behav;
-----------------------------
The problem when I run the program the upper code in the simulator can
give the result of signal 'Rm' = '1' very good. But when I use the
Quartus II syntheses tool to synthesize on the cyclone FPGA and I
assign the 'Rm' to the result the specific led gives nothing.
I think my problem that the next cycle of the process 'Result signal'
will be assigned to nothing, the Rm <= Result will get 'U' or 'Zero'.
Or anything.
The question is there any way to save the result of line:
Result <= func_rt(g, f, 3);
For infinity time, so I can use the Result Signal with newest value
anytime when the Ready signal became '1' .