Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed syntax error in forwarding unit and created empty tb
- Loading branch information
Christer
committed
Nov 11, 2012
1 parent
3ad7d8a
commit 5daad54
Showing
39 changed files
with
611 additions
and
550 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,74 @@ | ||
---------------------------------------------------------------------------------- | ||
-- Company: | ||
-- Engineer: | ||
-- | ||
-- Create Date: 00:18:02 11/11/2012 | ||
-- Design Name: | ||
-- Module Name: forwarding_unit - Behavioral | ||
-- Project Name: | ||
-- Target Devices: | ||
-- Tool versions: | ||
-- Description: | ||
-- | ||
-- Dependencies: | ||
-- | ||
-- Revision: | ||
-- Revision 0.01 - File Created | ||
-- Additional Comments: | ||
-- | ||
---------------------------------------------------------------------------------- | ||
library IEEE; | ||
use IEEE.STD_LOGIC_1164.ALL; | ||
|
||
-- Uncomment the following library declaration if using | ||
-- arithmetic functions with Signed or Unsigned values | ||
--use IEEE.NUMERIC_STD.ALL; | ||
|
||
-- Uncomment the following library declaration if instantiating | ||
-- any Xilinx primitives in this code. | ||
--library UNISIM; | ||
--use UNISIM.VComponents.all; | ||
|
||
entity forwarding_unit is | ||
Port ( exmem_reg_write : in STD_LOGIC; | ||
memwb_reg_write : in STD_LOGIC; | ||
exmem_reg_rd : in STD_LOGIC_VECTOR (4 downto 0); | ||
memwb_reg_rd : in STD_LOGIC_VECTOR (4 downto 0); | ||
idex_reg_rs : in STD_LOGIC_VECTOR (4 downto 0); | ||
idex_reg_rt : in STD_LOGIC_VECTOR (4 downto 0); | ||
forward_a : out STD_LOGIC_VECTOR (1 downto 0); | ||
forward_b : out STD_LOGIC_VECTOR (1 downto 0)); | ||
end forwarding_unit; | ||
|
||
architecture Behavioral of forwarding_unit is | ||
|
||
begin | ||
|
||
process | ||
begin | ||
-- 1a | ||
if (exmem_reg_write and (exmem_reg_rd /= "00000") and (exmem_reg_rd = idex_register_rs)) then | ||
forward_a <= "10"; | ||
-- 2a | ||
elsif (memwb_reg_write and (memwb_reg_rd /= "00000") and (exmem_reg_rd /= idex_register_rs) and (memwb_reg_rd = idex_reg_rs)) then | ||
forward_a <= "01"; | ||
-- default | ||
else | ||
forward_a <= "00"; | ||
end if; | ||
|
||
-- 1b | ||
if (exmem_reg_write and (exmem_reg_rd /= "00000") and (exmem_reg_rd = idex_register_rt)) then | ||
forward_b <= "10"; | ||
-- 2b | ||
elsif (memwb_reg_write and (memwb_reg_rd /= "00000") and (memwb_reg_rd /= idex_register_rt) and (memwb_reg_rd = idex_reg_rt)) then | ||
forward_b <= "01"; | ||
-- default | ||
else | ||
forward_b <= "00"; | ||
end if; | ||
|
||
end process; | ||
|
||
end Behavioral; | ||
|
||
---------------------------------------------------------------------------------- | ||
-- Company: | ||
-- Engineer: | ||
-- | ||
-- Create Date: 00:18:02 11/11/2012 | ||
-- Design Name: | ||
-- Module Name: forwarding_unit - Behavioral | ||
-- Project Name: | ||
-- Target Devices: | ||
-- Tool versions: | ||
-- Description: | ||
-- | ||
-- Dependencies: | ||
-- | ||
-- Revision: | ||
-- Revision 0.01 - File Created | ||
-- Additional Comments: | ||
-- | ||
---------------------------------------------------------------------------------- | ||
library IEEE; | ||
use IEEE.STD_LOGIC_1164.ALL; | ||
|
||
-- Uncomment the following library declaration if using | ||
-- arithmetic functions with Signed or Unsigned values | ||
--use IEEE.NUMERIC_STD.ALL; | ||
|
||
-- Uncomment the following library declaration if instantiating | ||
-- any Xilinx primitives in this code. | ||
--library UNISIM; | ||
--use UNISIM.VComponents.all; | ||
|
||
entity forwarding_unit is | ||
Port ( exmem_reg_write : in STD_LOGIC; | ||
memwb_reg_write : in STD_LOGIC; | ||
exmem_reg_rd : in STD_LOGIC_VECTOR (4 downto 0); | ||
memwb_reg_rd : in STD_LOGIC_VECTOR (4 downto 0); | ||
idex_reg_rs : in STD_LOGIC_VECTOR (4 downto 0); | ||
idex_reg_rt : in STD_LOGIC_VECTOR (4 downto 0); | ||
forward_a : out STD_LOGIC_VECTOR (1 downto 0); | ||
forward_b : out STD_LOGIC_VECTOR (1 downto 0)); | ||
end forwarding_unit; | ||
|
||
architecture Behavioral of forwarding_unit is | ||
|
||
begin | ||
|
||
process | ||
begin | ||
-- 1a | ||
if (exmem_reg_write and (exmem_reg_rd /= "00000") and (exmem_reg_rd = idex_reg_rs)) then | ||
forward_a <= "10"; | ||
-- 2a | ||
elsif (memwb_reg_write and (memwb_reg_rd /= "00000") and (exmem_reg_rd /= idex_reg_rs) and (memwb_reg_rd = idex_reg_rs)) then | ||
forward_a <= "01"; | ||
-- default | ||
else | ||
forward_a <= "00"; | ||
end if; | ||
|
||
-- 1b | ||
if (exmem_reg_write and (exmem_reg_rd /= "00000") and (exmem_reg_rd = idex_reg_rt)) then | ||
forward_b <= "10"; | ||
-- 2b | ||
elsif (memwb_reg_write and (memwb_reg_rd /= "00000") and (memwb_reg_rd /= idex_reg_rt) and (memwb_reg_rd = idex_reg_rt)) then | ||
forward_b <= "01"; | ||
-- default | ||
else | ||
forward_b <= "00"; | ||
end if; | ||
|
||
end process; | ||
|
||
end Behavioral; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,103 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<generated_project xmlns="http://www.xilinx.com/XMLSchema" xmlns:xil_pn="http://www.xilinx.com/XMLSchema"> | ||
|
||
<!-- --> | ||
|
||
<!-- For tool use only. Do not edit. --> | ||
|
||
<!-- --> | ||
|
||
<!-- ProjectNavigator created generated project file. --> | ||
|
||
<!-- For use in tracking generated file and other information --> | ||
|
||
<!-- allowing preservation of process status. --> | ||
|
||
<!-- --> | ||
|
||
<!-- Copyright (c) 1995-2010 Xilinx, Inc. All rights reserved. --> | ||
|
||
<version xmlns="http://www.xilinx.com/XMLSchema">11.1</version> | ||
|
||
<sourceproject xmlns="http://www.xilinx.com/XMLSchema" xil_pn:fileType="FILE_XISE" xil_pn:name="oving1.xise"/> | ||
|
||
<files xmlns="http://www.xilinx.com/XMLSchema"> | ||
<file xil_pn:fileType="FILE_NCD" xil_pn:name="toplevel_guide.ncd" xil_pn:origination="imported"/> | ||
</files> | ||
|
||
<transforms xmlns="http://www.xilinx.com/XMLSchema"/> | ||
|
||
</generated_project> | ||
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> | ||
<generated_project xmlns="http://www.xilinx.com/XMLSchema" xmlns:xil_pn="http://www.xilinx.com/XMLSchema"> | ||
|
||
<!-- --> | ||
|
||
<!-- For tool use only. Do not edit. --> | ||
|
||
<!-- --> | ||
|
||
<!-- ProjectNavigator created generated project file. --> | ||
|
||
<!-- For use in tracking generated file and other information --> | ||
|
||
<!-- allowing preservation of process status. --> | ||
|
||
<!-- --> | ||
|
||
<!-- Copyright (c) 1995-2010 Xilinx, Inc. All rights reserved. --> | ||
|
||
<version xmlns="http://www.xilinx.com/XMLSchema">11.1</version> | ||
|
||
<sourceproject xmlns="http://www.xilinx.com/XMLSchema" xil_pn:fileType="FILE_XISE" xil_pn:name="oving1.xise"/> | ||
|
||
<files xmlns="http://www.xilinx.com/XMLSchema"> | ||
<file xil_pn:branch="BehavioralSim" xil_pn:fileType="FILE_MODELSIM_CMD" xil_pn:name="tb_toplevel.fdo"/> | ||
<file xil_pn:fileType="FILE_NCD" xil_pn:name="toplevel_guide.ncd" xil_pn:origination="imported"/> | ||
</files> | ||
|
||
<transforms xmlns="http://www.xilinx.com/XMLSchema"> | ||
<transform xil_pn:end_ts="1352646716" xil_pn:name="TRAN_copyInitialToAbstractSimulation" xil_pn:start_ts="1352646716"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
</transform> | ||
<transform xil_pn:end_ts="1352647073" xil_pn:in_ck="7061694717294192413" xil_pn:name="TRAN_copyAbstractToPostAbstractSimulation" xil_pn:start_ts="1352647073"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
<outfile xil_pn:name="alu.vhd"/> | ||
<outfile xil_pn:name="control_unit.vhd"/> | ||
<outfile xil_pn:name="forwarding_unit.vhd"/> | ||
<outfile xil_pn:name="pc.vhd"/> | ||
<outfile xil_pn:name="reg_32.vhd"/> | ||
<outfile xil_pn:name="reg_exmem.vhd"/> | ||
<outfile xil_pn:name="reg_idex.vhd"/> | ||
<outfile xil_pn:name="reg_ifid.vhd"/> | ||
<outfile xil_pn:name="reg_memwb.vhd"/> | ||
<outfile xil_pn:name="tb_adder.vhd"/> | ||
<outfile xil_pn:name="tb_alu.vhd"/> | ||
<outfile xil_pn:name="tb_alu_control.vhd"/> | ||
<outfile xil_pn:name="tb_control_unit.vhd"/> | ||
<outfile xil_pn:name="tb_forwarding_unit.vhd"/> | ||
<outfile xil_pn:name="tb_pc.vhd"/> | ||
<outfile xil_pn:name="tb_reg_exmem.vhd"/> | ||
<outfile xil_pn:name="tb_reg_idex.vhd"/> | ||
<outfile xil_pn:name="tb_reg_ifid.vhd"/> | ||
<outfile xil_pn:name="tb_reg_memwb.vhd"/> | ||
<outfile xil_pn:name="tb_sign_extend.vhd"/> | ||
<outfile xil_pn:name="tb_toplevel.vhd"/> | ||
</transform> | ||
<transform xil_pn:end_ts="1352646716" xil_pn:name="TRAN_xawsToSimhdl" xil_pn:prop_ck="-3623050530995557290" xil_pn:start_ts="1352646716"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
</transform> | ||
<transform xil_pn:end_ts="1352646716" xil_pn:name="TRAN_schematicsToHdlSim" xil_pn:prop_ck="3144195386269199572" xil_pn:start_ts="1352646716"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
</transform> | ||
<transform xil_pn:end_ts="1352646716" xil_pn:name="TRAN_regenerateCoresSim" xil_pn:prop_ck="-8177611997605138438" xil_pn:start_ts="1352646716"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
</transform> | ||
<transform xil_pn:end_ts="1352647074" xil_pn:in_ck="7061694717294192413" xil_pn:name="TRAN_copyPostAbstractToPreSimulation" xil_pn:start_ts="1352647073"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
<outfile xil_pn:name="alu.vhd"/> | ||
<outfile xil_pn:name="control_unit.vhd"/> | ||
<outfile xil_pn:name="forwarding_unit.vhd"/> | ||
<outfile xil_pn:name="pc.vhd"/> | ||
<outfile xil_pn:name="reg_32.vhd"/> | ||
<outfile xil_pn:name="reg_exmem.vhd"/> | ||
<outfile xil_pn:name="reg_idex.vhd"/> | ||
<outfile xil_pn:name="reg_ifid.vhd"/> | ||
<outfile xil_pn:name="reg_memwb.vhd"/> | ||
<outfile xil_pn:name="tb_adder.vhd"/> | ||
<outfile xil_pn:name="tb_alu.vhd"/> | ||
<outfile xil_pn:name="tb_alu_control.vhd"/> | ||
<outfile xil_pn:name="tb_control_unit.vhd"/> | ||
<outfile xil_pn:name="tb_forwarding_unit.vhd"/> | ||
<outfile xil_pn:name="tb_pc.vhd"/> | ||
<outfile xil_pn:name="tb_reg_exmem.vhd"/> | ||
<outfile xil_pn:name="tb_reg_idex.vhd"/> | ||
<outfile xil_pn:name="tb_reg_ifid.vhd"/> | ||
<outfile xil_pn:name="tb_reg_memwb.vhd"/> | ||
<outfile xil_pn:name="tb_sign_extend.vhd"/> | ||
<outfile xil_pn:name="tb_toplevel.vhd"/> | ||
</transform> | ||
<transform xil_pn:end_ts="1352647077" xil_pn:in_ck="7061694717294192413" xil_pn:name="TRAN_MSimulateBehavioralModel" xil_pn:prop_ck="889151390353550919" xil_pn:start_ts="1352647074"> | ||
<status xil_pn:value="SuccessfullyRun"/> | ||
<status xil_pn:value="ReadyToRun"/> | ||
<outfile xil_pn:name="tb_toplevel.fdo"/> | ||
</transform> | ||
</transforms> | ||
|
||
</generated_project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
work "reg_memwb.vhd" | ||
work "forwarding_unit.vhd" |
Oops, something went wrong.