|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
关于控制总线信号的VHDL描述我目前知道的两种方法,方法如下:
第一种:commond_cnt是一个按输入时钟为源的计数器,按照控制信号的时序顺序来依次给信号赋值法:
case commond_cnt is
when x"0fa2" => --enable the control signal
iodir_reg<='1'; --output
ale_reg<='0';
cle_reg<='1';
we_reg<='0';
wp_reg<='1';
re_reg<='1';
databusout_reg<=x"70";
cs_out_reg<=(others=>'0');
when x"0fa4"=>
we_reg<='1'; --input the read status commond
when x"0fb0"=>
cle_reg<='0';
--
databusout_reg(7 downto 0)<=x"70"; --input the read_status commond
cs_out_reg<=(0=>'0',others=>'1'); --just enable the cs1 chip;
--
we_reg<='0';
--
when x"0fb3" =>
--
we_reg<='1';
when x"0fb8"=> --read the status byte
iodir_reg<='0'; --change the dir of the port to input
--
cle_reg<='0';
when x"0fbf"=>
re_reg<='0'; --falling edge of the re to capture the status byte
when x"0fd0"=>
iodir_reg<='1'; --output
re_reg<='1';
第二种:根据各个时间点,各信号的电平情况单独赋值:
if(cnt=x"0001" or cnt=x"0005") then
cle<='1';
else
cle<='0';
end if;
if(cnt>x"1" and cnt<x"0005") then
ale<='1';
else
ale<='0';
end if;
if(cnt>x"0000" and cnt<x"0006")then
flag_we:=not flag_we;
we<=not flag_we;
else
we<='1';
end if;
想问一下到底该用哪种方法呢?这两种方法有什么区别?我是觉得第一种方法可读性强一些; |
|