parent
25f67ed707
commit
83229c5c85
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
GHDL = ghdl
|
GHDL = ghdl
|
||||||
all : sim_alu sim_shifter
|
all : sim_alu #sim_shifter
|
||||||
|
|
||||||
%.o : %.vhdl
|
%.o : %.vhdl
|
||||||
${GHDL} -a -g -v $^
|
${GHDL} -a -g -v $^
|
||||||
|
|
|
@ -3,10 +3,10 @@ use ieee.math_real.all;
|
||||||
use ieee.numeric_std.all;
|
use ieee.numeric_std.all;
|
||||||
use ieee.std_logic_1164.all;
|
use ieee.std_logic_1164.all;
|
||||||
|
|
||||||
entity ALU_tb is
|
entity ALU is
|
||||||
end ALU_tb;
|
end ALU;
|
||||||
|
|
||||||
architecture Structurel of ALU_tb is
|
architecture Structurel of ALU is
|
||||||
|
|
||||||
--! ######## signals for component ########
|
--! ######## signals for component ########
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ architecture Structurel of ALU_tb is
|
||||||
end function;
|
end function;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
alu_0 : entity work.ALU
|
alu_0 : entity work.alu
|
||||||
port map(
|
port map(
|
||||||
op1 => op1,
|
op1 => op1,
|
||||||
op2 => op2,
|
op2 => op2,
|
||||||
|
|
|
@ -39,7 +39,6 @@ architecture Shifter_bhvr of Shifter is
|
||||||
begin
|
begin
|
||||||
temp_dout := din;
|
temp_dout := din;
|
||||||
temp_cout := cin;
|
temp_cout := cin;
|
||||||
|
|
||||||
-- LSL -------------------------------------------------------------
|
-- LSL -------------------------------------------------------------
|
||||||
-- 1
|
-- 1
|
||||||
if(shift_lsl='1' and shift_val(0)='1')
|
if(shift_lsl='1' and shift_val(0)='1')
|
||||||
|
|
|
@ -39,8 +39,8 @@ port map(
|
||||||
process
|
process
|
||||||
begin
|
begin
|
||||||
shift_ror <= '1';
|
shift_ror <= '1';
|
||||||
shift_val <= "00100";
|
shift_val <= "00010";
|
||||||
din <= std_logic_vector(to_unsigned(4, 32));
|
din <= std_logic_vector(to_unsigned(32654, 32));
|
||||||
wait for 5 ns;
|
wait for 5 ns;
|
||||||
report "dout = " & integer'image(to_integer(unsigned(dout)));
|
report "dout = " & integer'image(to_integer(unsigned(dout)));
|
||||||
WAIT;
|
WAIT;
|
||||||
|
|
Loading…
Reference in New Issue