git-svn-id: http://moon:8086/svn/vhdl/trunk@1429 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2021-03-21 12:04:37 +00:00
parent 9edf6a70af
commit 2f7ab91e0d
116 changed files with 50542 additions and 0 deletions
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
work
+1
View File
@@ -0,0 +1 @@
vhdl work "main_top.vhdl"
+86
View File
@@ -0,0 +1,86 @@
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
-- Uncomment the following lines to use the declarations that are
-- provided for instantiating Xilinx primitive components.
--library UNISIM;
--use UNISIM.VComponents.all;
entity main_top is
Port ( clk : in std_logic;
resn : in std_logic;
a : in std_logic_vector(31 downto 0);
d : inout std_logic_vector(31 downto 0);
wen : in std_logic;
csn : in std_logic);
end main_top;
architecture Behavioral of main_top is
type t_reg is array (31 downto 0) of std_logic ;
signal reg_a, reg_b, reg_c : t_reg;
signal cs_a, cs_b, cs_c, CI, CO : std_logic;
signal dmuxo : std_logic_vector(31 downto 0);
signal mux_ctrl : std_logic_vector (3 downto 0);
signal AA,BB,S31: std_logic_vector(32-1 downto 0);
signal sum : std_logic_vector(32 downto 0);
signal zeros: std_logic_vector(32-1 downto 0) := (others => '0');
begin
mux_ctrl <= a(7 downto 4);
dmuxo <= std_logic_vector(reg_a) when (mux_ctrl = X"0") else
std_logic_vector(reg_b) when (mux_ctrl = X"1") else
std_logic_vector(reg_c) when (mux_ctrl = X"2") else
X"12345678";
cs_a <= '1' when (mux_ctrl = X"0" and csn = '0') else '0';
cs_b <= '1' when (mux_ctrl = X"1" and csn = '0') else '0';
cs_c <= '1' when (mux_ctrl = X"2" and csn = '0') else '0';
CI <= wen;
AA <= dmuxo when (wen = '1' and csn = '0') else (31 downto 0 => 'Z');
BB <=a;
d <= S31;
write_reg_a: process (clk, wen, cs_a, d)
begin
if clk'event and clk = '0' then
if (wen = '0' and cs_a = '1') then
reg_a <= t_reg(d);
end if;
end if;
end process;
write_reg_b: process (clk, wen, cs_b, d)
begin
if clk'event and clk = '0' then
if (wen = '0' and cs_b = '1') then
reg_b <= t_reg(d);
end if;
end if;
end process;
write_reg_c: process (clk, wen, cs_c, d)
begin
if clk'event and clk = '0' then
if (wen = '0' and cs_c = '1') then
reg_c <= t_reg(d);
end if;
end if;
end process;
process (CI, AA, BB, sum)
begin
sum <= ('0' & AA) + ('0' & BB) + (zeros & CI);
S31 <= sum(32-1 downto 0);
CO <= sum(32);
end process;
end Behavioral;
+53
View File
@@ -0,0 +1,53 @@
set -tmpdir ./xst/projnav.tmp
set -xsthdpdir ./xst
run
-ifn main_top.prj
-ifmt mixed
-ofn main_top
-ofmt NGC
-p xc3s50-5-tq144
-top main_top
-opt_mode Speed
-opt_level 1
-iuc NO
-lso main_top.lso
-keep_hierarchy NO
-rtlview Yes
-glob_opt AllClockNets
-read_cores YES
-write_timing_constraints NO
-cross_clock_analysis NO
-hierarchy_separator _
-bus_delimiter <>
-case maintain
-slice_utilization_ratio 100
-verilog2001 YES
-fsm_extract YES -fsm_encoding Auto
-safe_implementation No
-fsm_style lut
-ram_extract Yes
-ram_style Auto
-rom_extract Yes
-mux_style Auto
-decoder_extract YES
-priority_extract YES
-shreg_extract YES
-shift_extract YES
-xor_collapse YES
-rom_style Auto
-mux_extract YES
-resource_sharing YES
-mult_style auto
-iobuf YES
-max_fanout 500
-bufg 8
-register_duplication YES
-register_balancing No
-slice_packing YES
-optimize_primitives NO
-use_clock_enable Yes
-use_sync_set Yes
-use_sync_reset Yes
-iob auto
-equivalent_register_removal YES
-slice_utilization_ratio_maxmargin 5
@@ -0,0 +1,13 @@
## NOTE: Do not edit this file.
## Autogenerated by ProjNav (creatfdo.tcl) on Wed Jun 02 00:28:35 Westeuropäische Sommerzeit 2004
##
vlib work
vcom -93 -explicit main_top.vhdl
vcom -93 -explicit main_top_tb.vhd
vsim -t 1ps -lib work main_top_main_top_tb_vhd_tb
do main_top_main_top_tb_vhd_tb.udo
view wave
add wave *
view structure
view signals
run 1000ns
@@ -0,0 +1,15 @@
## NOTE: Do not edit this file.
## Auto generated by Project Navigator for VHDL Post-Translate Simulation
##
vlib work
## Compile Post-Translate Model for Module main_top
vcom -87 -explicit main_top_translate.vhd
vcom -93 -explicit main_top_tb.vhd
vsim -t 1ps -lib work main_top_main_top_tb_vhd_tb
do main_top_main_top_tb_vhd_tb.udo
view wave
add wave *
view structure
view signals
run 1000ns
## End
@@ -0,0 +1,15 @@
## NOTE: Do not edit this file.
## Auto generated by Project Navigator for VHDL Post-PAR Simulation
##
vlib work
## Compile Post-PAR Model for Module main_top
vcom -87 -explicit main_top_timesim.vhd
vcom -93 -explicit main_top_tb.vhd
vsim -t 1ps -sdfmax /UUT=main_top_timesim.sdf -lib work main_top_main_top_tb_vhd_tb
do main_top_main_top_tb_vhd_tb.udo
view wave
add wave *
view structure
view signals
run 1000ns
## End
@@ -0,0 +1,4 @@
-- ProjNav VHDL simulation template: main_top_main_top_tb_vhd_tb.udo
-- You may edit this file after the line that starts with
-- '-- START' to customize your simulation
-- START user-defined simulation commands
+134
View File
@@ -0,0 +1,134 @@
-- VHDL Test Bench Created from source file main_top.vhd -- 00:26:28 06/02/2004
--
-- Notes:
-- This testbench has been automatically generated using types std_logic and
-- std_logic_vector for the ports of the unit under test. Xilinx recommends
-- that these types always be used for the top-level I/O of a design in order
-- to guarantee that the testbench will bind correctly to the post-implementation
-- simulation model.
--
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY main_top_main_top_tb_vhd_tb IS
END main_top_main_top_tb_vhd_tb;
ARCHITECTURE behavior OF main_top_main_top_tb_vhd_tb IS
COMPONENT main_top
PORT(
clk : IN std_logic;
resn : IN std_logic;
a : IN std_logic_vector(31 downto 0);
wen : IN std_logic;
csn : IN std_logic;
d : INOUT std_logic_vector(31 downto 0)
);
END COMPONENT;
SIGNAL clk : std_logic;
SIGNAL resn : std_logic;
SIGNAL a : std_logic_vector(31 downto 0);
SIGNAL d : std_logic_vector(31 downto 0);
SIGNAL wen : std_logic;
SIGNAL csn : std_logic;
constant ClockPeriod : Time := 25 ns;
BEGIN
uut: main_top PORT MAP(
clk => clk,
resn => resn,
a => a,
d => d,
wen => wen,
csn => csn
);
clockgen: process
begin
clk <= '1';
loop
wait for (ClockPeriod / 2);
clk <= not clk;
end loop;
end process;
-- *** Test Bench - User Defined Section ***
tb : PROCESS
BEGIN
wait for 8*ClockPeriod;
resn <= '1';
wait for 4*ClockPeriod;
wen <= '0';
a <= X"00000000";
wait for 1*ClockPeriod;
d <= X"AAAAAAAA";
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
a <= X"00000010";
wait for 1*ClockPeriod;
d <= X"BBBBBBBB";
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
a <= X"00000020";
wait for 1*ClockPeriod;
d <= X"CCCCCCCC";
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
a <= X"00000030";
wait for 1*ClockPeriod;
d <= X"DDDDDDDD";
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
wait for 8*ClockPeriod;
wen <= '1';
a <= X"00000000";
wait for 1*ClockPeriod;
d <= (31 downto 0 => 'Z');
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
a <= X"00000010";
wait for 1*ClockPeriod;
d <= (31 downto 0 => 'Z');
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
a <= X"00000020";
wait for 1*ClockPeriod;
d <= (31 downto 0 => 'Z');
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
a <= X"00000030";
wait for 1*ClockPeriod;
d <= (31 downto 0 => 'Z');
csn <= '0';
wait for 1*ClockPeriod;
csn <= '1';
wait; -- will wait forever
END PROCESS;
-- *** End Test Bench - User Defined Section ***
END;
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
work main_top.vhdl
+28
View File
@@ -0,0 +1,28 @@
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -format Logic /main_top_main_top_tb_vhd_tb/clk
add wave -noupdate -format Logic /main_top_main_top_tb_vhd_tb/resn
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/a
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/d
add wave -noupdate -format Logic /main_top_main_top_tb_vhd_tb/wen
add wave -noupdate -format Logic /main_top_main_top_tb_vhd_tb/csn
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/uut/reg_a
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/uut/reg_b
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/uut/reg_c
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/uut/dmuxo
add wave -noupdate -format Literal -radix hexadecimal /main_top_main_top_tb_vhd_tb/uut/mux_ctrl
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {684150 ps} 0}
WaveRestoreZoom {356007 ps} {1033895 ps}
configure wave -namecolwidth 150
configure wave -valuecolwidth 100
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
configure wave -datasetprefix 0
configure wave -rowmargin 4
configure wave -childrowmargin 2
configure wave -gridoffset 0
configure wave -gridperiod 1
configure wave -griddelta 40
configure wave -timeline 0