Skip to content
Snippets Groups Projects
Commit 58cb7267 authored by Solveig Langbakk's avatar Solveig Langbakk
Browse files

trekker ut funksjoner

parent b371ddaa
No related branches found
No related tags found
No related merge requests found
......@@ -65,6 +65,25 @@ architecture RTL of Controller is
end if;
end function statusCheck;
function getStatusFromRx(databus: std_logic_vector(7 downto 0))return std_logic is
begin
Rd_sig <= '1';
adress <= "101";
end function getStatusFromRx;
function sendDataToTx(databus: std_logic_vector(7 downto 0)) return std_logic is
begin
if txBusy = '0' then
adress <= "001";
Data_bus <= databus;
Wr_sig <= '1';
else
Rd_sig <= '1';
Data_bus <= databus;
end if;
end function sendDataToTx;
--Arkitekturen begynner
begin
......@@ -104,19 +123,22 @@ begin
statusChecker(turnTaker);
if Data_bus = "ZZZZZZZZ" then
--do nothing
Rd_sig <= '0';
else if Rd_sig = '1' then
sendDataToTx(Data_bus);
else
if turnTaker = '1' then -- da skal vi sjekke om TX er busy
if Data_bus(0 downto 0) = "1" then
txBusy <= '1';
elsif turnTaker = '0' then -- Skal sjekke om Rx har data til oss, status på fifo osv.
--if Data_bus()
getStatusFromRx(Data_bus);
else
end if;
end if;
end if;
end if;
--end if;
end if;
end process p_clk;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment