查看: 4113|回复: 1

FPGA 运行 51 IPcore

[复制链接]
  • TA的每日心情
    慵懒
    2016-10-17 12:07
  • 签到天数: 306 天

    连续签到: 1 天

    [LV.8]以坛为家I

    发表于 2016-9-29 11:14:21 | 显示全部楼层 |阅读模式
    分享到:
    本帖最后由 liunian__92 于 2016-9-29 11:20 编辑

        51 IPcore 早在十几年前就已经有人写过了。网上类似的教程也有很多。自己写这篇文章,参考着前人探索的道路来学习。
    本文中使用的是Oregano System 的 8051 IPcore ,相关资料如下,可以下载看一下。
    【资料】    
         Oregano System:http://www.oreganosystems.at/?page_id=96
         8051       指令集:http://www.keil.com/dd/docs/datashts/intel/ism51.pdf
         8051  Datasheet:http://www.keil.com/dd/docs/datashts/intel/80xxah_ds.pdf
         8051IPcore        :http://www.keil.com/dd/docs/datashts/oregano/mc8051_ug.pdf

    首先去官网下载Oregan System 的8051IPcore 的源码,是用VHDL语言写的。
    我们使用的是 vhdl 文件夹的内容,这个文件夹里就是 8051 的IP core 的实现。

    一、生成 8051 原理图
          1、 打开 quartus II 新建工程文件,将vhdl 中的文件夹中的文件添加到工程中。_cfg 和 _top_ 此类的文件不要添加进来。
          2、将mc8051_p.vhd 下面的模块化文件都删除掉。如下的内容:
    1. component mc8051_top
    2.     port (clk         : in  std_logic;
    3.           reset       : in  std_logic;
    4.           int0_i      : in  std_logic_vector(C_IMPL_N_EXT-1 downto 0);
    5.           int1_i      : in  std_logic_vector(C_IMPL_N_EXT-1 downto 0);
    6.           all_t0_i    : in  std_logic_vector(C_IMPL_N_TMR-1 downto 0);
    7.           all_t1_i    : in  std_logic_vector(C_IMPL_N_TMR-1 downto 0);
    8.           all_rxd_i   : in  std_logic_vector(C_IMPL_N_SIU-1 downto 0);
    9.           p0_i        : in  std_logic_vector(7 downto 0);
    10.           p1_i        : in  std_logic_vector(7 downto 0);
    11.           p2_i        : in  std_logic_vector(7 downto 0);
    12.           p3_i        : in  std_logic_vector(7 downto 0);
    13.           p0_o        : out std_logic_vector(7 downto 0);
    14.           p1_o        : out std_logic_vector(7 downto 0);
    15.           p2_o        : out std_logic_vector(7 downto 0);
    16.           p3_o        : out std_logic_vector(7 downto 0);
    17.           all_rxd_o   : out std_logic_vector(C_IMPL_N_SIU-1 downto 0);
    18.           all_txd_o   : out std_logic_vector(C_IMPL_N_SIU-1 downto 0);
    19.           all_rxdwr_o : out std_logic_vector(C_IMPL_N_SIU-1 downto 0));
    20.   end component;
    21.   -----------------------------------------------------------------------------
    22.   -- START: Component declarations for simulation models
    23.   -----------------------------------------------------------------------------
    24.   component mc8051_ram
    25.     port (clk        : in  std_logic;
    26.       reset      : in  std_logic;
    27.       ram_data_i : in  std_logic_vector(7 downto 0);
    28.           ram_data_o : out std_logic_vector(7 downto 0);
    29.           ram_adr_i  : in  std_logic_vector(6 downto 0);
    30.           ram_wr_i   : in  std_logic;
    31.           ram_en_i   : in  std_logic);
    32.   end component;
    33.   component mc8051_ramx
    34.     port (clk        : in  std_logic;
    35.       reset      : in  std_logic;
    36.       ram_data_i : in  std_logic_vector(7 downto 0);
    37.           ram_data_o : out std_logic_vector(7 downto 0);
    38.           ram_adr_i  : in  std_logic_vector(15 downto 0);
    39.           ram_wr_i   : in  std_logic);
    40.   end component;
    41.   component mc8051_rom
    42.     port (clk        : in  std_logic;
    43.       reset      : in  std_logic;
    44.       rom_data_o : out std_logic_vector(7 downto 0);
    45.           rom_adr_i  : in  std_logic_vector(15 downto 0));
    46.   end component;
    47.   -----------------------------------------------------------------------------
    48.   -- END: Component declarations for simulation models
    49.   -----------------------------------------------------------------------------
    复制代码
    3、打开文件 mc8051_core.vhd
          4、点击   File ->  Create/Update ->  Create Symbole File From Current File    之后可以生成 8051 内核的原理图了。

    二、 添加片内外设
         1、 将生成好的 8051 内核原理图文件,添加进来。
         2、这只是一个Core 还有RAM 、ROM 和GPIO等为系统添加。RAM 和ROM是必须的 ,RAMX 是外扩的RAM。ram和rom配置的时候都要把 ‘q‘output port 的勾去掉!不能选择寄存器输出。
         3、在配置ROM 的时候,将 Keil 生成的 bin文件添加进来。
    1. #include <reg52.h>

    2. void main()
    3. {
    4.     char i = 0x55;
    5.     while(1);
    6. }
    复制代码
    三、连接图
             
          sum.jpg

    Figure-1  BirdView

    sum1-1.jpg

    Figure-2  PLL

    sum1-2.jpg


    Figure-3  RAM\ROM\RAMX


    【参考内容】
        [1]  http://blog.sina.com.cn/s/blog_52e8baa40100t52i.html

    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-9-20 09:51
  • 签到天数: 35 天

    连续签到: 2 天

    [LV.5]常住居民I

    发表于 2022-8-16 10:22:54 | 显示全部楼层
    非常不错的思路,值得推荐
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

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

    手机版|小黑屋|与非网

    GMT+8, 2024-4-20 20:20 , Processed in 0.127670 second(s), 17 queries , MemCache On.

    ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

    苏公网安备 32059002001037号

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.