⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aluuva16a.do

📁 16bit 定点DSP。是很精练的例子
💻 DO
字号:
echo
echo
echo #########################################
echo " Simulation Script 'ALUuva16a' using ModelSimXE 5.3d   #"
echo " v010411  Ok  Santiago de Pablo (sanpab@eis.uva.es)   #"
echo #########################################
echo

-- Test of Logic ALU.

restart -force
delete wave -r *
radix hexadecimal
echo

add wave Clk
add wave Phase
add wave InA
add wave InB
--add wave InC
add wave OpCode
--add wave FlagIn
--add wave OutMAC
add wave OutLogic
--add wave OutArith
--add wave Vflag

--add wave OpA
--add wave OpB
--add wave AddA
--add wave AddB


echo

-- Global signals

force Clk 1 0ns, 0 50ns -repeat 100ns
force Phase 0 15ns, 1 115ns, 3 215 ns, 2 315 ns -repeat 400ns

-- Initialize

force	FlagIn	0		0ns
force	OpCode	16#F		0ns
force	InA	16#FFFF00	0ns
force	InB	16#FFFF00	0ns
run 300ns


-----------------------
-- Tests "rS and rT" --
-----------------------

force	OpCode	16#C		15ns

-- 0x00FF and 0x3A3A = 0x003A00 ok

force	InA	16#00FF00	15ns
force	InB	16#3A3A00	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0x003a00."
run 250ns


-- 0xA3A3 and 0xFF00 = 0xA30000 ok

force	InA	16#A3A300	15ns
force	InB	16#FF0000	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0xa30000."
run 250ns



----------------------
-- Tests "rS or rT" --
----------------------

force	OpCode	16#D		15ns


-- 0x00FF or 0x3A3A = 0x3AFF00 ok

force	InA	16#00FF00	15ns
force	InB	16#3A3A00	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0x3aff00."
run 250ns


-- 0xA3A3 or 0xFF00 = 0xFFA300 ok

force	InA	16#A3A300	15ns
force	InB	16#FF0000	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0xffa300."
run 250ns



-----------------------
-- Tests "rS nor rT" --
-----------------------

force	OpCode	16#E		15ns


-- 0x00FF nor 0x3A3A = 0xC5FF00 ok

force	InA	16#00FF00	15ns
force	InB	16#3A3A00	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0xc500ff."
run 250ns


-- 0xA3A3 nor 0xFF00 = 0x005CFF ok

force	InA	16#A3A300	15ns
force	InB	16#FF0000	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0x005cff."
run 250ns



-----------------------
-- Tests "rS xor rT" --
-----------------------

force	OpCode	16#F		15ns

-- 0x00FF xor 0x3A3A = 0x3AC500 ok

force	InA	16#00FF00	15ns
force	InB	16#3A3A00	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0x3ac500."
run 250ns


-- 0xA3A3 xor 0xFF00 = 0x5CA300 ok

force	InA	16#A3A300	15ns
force	InB	16#FF0000	15ns

run 150ns
echo "$now ns: OutLogic is 0x[examine -hex OutLogic] vs 0x5ca300."
run 250ns


echo
echo All lines above must match.

-- End of file --

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -