在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 2146|回复: 1

[求助] 有个代码看不懂,求板上各位大大帮忙

[复制链接]
发表于 2010-9-4 15:13:29 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
前几天在opencores上面看到一个DFP,下载了放在ise里面跑最后发现有错误。。。但是作者说已经跑通了。。。
-- Uart wrapped in a WiGGL interface  Rob Chapman  Dec 8, 03
-- Copyright Rob Chapman 1990-2005
-- this forms a serial communications interface for DFP
-- Four EIO locations are required: sci_data, sci_rf, sci_tx, sci_baud
library ieee;
use ieee.std_logic_1164.all;
use work.dfp_types.all;
use work.program.all;
entity sci is
  port( clock : in std_logic;     -- WiGGL interface
        location : in Cell;
        write : in bit;
        datai : in Cell;
        datao : out std_logic_vector(Cell'high downto 0);
        tx_sdata : out std_logic; -- serial interface
        rx_sdata : in std_logic);
end sci;
architecture behavioral of sci is
  signal tx_pdata, rx_pdata : std_logic_vector(7 downto 0);
  signal rx_full, tx_empty, load, read : std_logic;
  signal baud : std_logic_vector(2 downto 0) := "001";
  signal address : Cell_nat;
  signal datai8 : bit_vector(7 downto 0);
begin
-- instantiate a uart
uart0 : entity work.uart
  port map(
    clock, rx_sdata, tx_sdata, rx_pdata, tx_pdata, rx_full, tx_empty, load, read, baud);
-- map address and data in
  tx_pdata <= to_stdlogicvector(datai(7 downto 0));  -- connect to data in bus
  address <= morf(location);  -- for indexing

-- map outputs to datao
  process(address,rx_pdata,rx_full,tx_empty,baud)
    variable rx_pdatab : bit_vector(7 downto 0);
  begin
    case address is
      when sci_data =>
        datao <= (others => '0');
        rx_pdatab := morf(rx_pdata);
        datao(7 downto 0) <= to_stdlogicvector(rx_pdatab);
      when sci_rf =>
        datao <= (0 => rx_full, others => '0');
      when sci_te =>
        datao <= (0 => tx_empty, others => '0');
      when sci_baud =>        
    datao <= (others => '0');
        datao(2 downto 0) <= baud;
      when others =>
        datao <= (others => 'Z');
    end case;
  end process;      
-- take care of writes and read
  process(clock)
  begin
    if rising_edge(clock) then
      load <= '0';
      read <= '0';
      if write = '1' then
        if address = sci_data then
          load <= '1';
        elsif address = sci_baud then
   
          baud <= to_stdlogicvector(datai(2 downto 0));
        end if;
      else
        if address = sci_data then
          read <= '1';
        end if;
      end if;
    end if;
  end process;
end behavioral;


ERROR:HDLParsers:3312 - "D:/dfp1/dfp1/sci.vhd" Line 53. Undefined symbol 'sci_baud'.
ERROR:HDLParsers:1209 - "D:/dfp1/dfp1/sci.vhd" Line 53. sci_baud: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "D:/dfp1/dfp1/sci.vhd" Line 70. Undefined symbol 'sci_baud'.
ERROR:HDLParsers:1209 - "D:/dfp1/dfp1/sci.vhd" Line 70. sci_baud: Undefined symbol (last report in this block)

上面说那个信号没有。。。但是我后来仔细看了一下,case的其他语句的那些信号量也没有啊。。。为什么报错就报了这个变量呀?
发表于 2010-9-4 18:26:19 | 显示全部楼层
use work.dfp_types.all;
use work.program.all;
可能是这两个包的问题,应该是作者自己的程序包,不是VHDL默认的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-10-5 15:26 , Processed in 0.052496 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表