target.vhd
来自「宇航级微处理器LEON2 2.2 VHDL源代码,很难找的.」· VHDL 代码 · 共 515 行 · 第 1/2 页
VHD
515 行
------------------------------------------------------------------------------ This file is a part of the LEON VHDL model-- Copyright (C) 1999 European Space Agency (ESA)---- This library is free software; you can redistribute it and/or-- modify it under the terms of the GNU Lesser General Public-- License as published by the Free Software Foundation; either-- version 2 of the License, or (at your option) any later version.---- See the file COPYING.LGPL for the full details of the license.------------------------------------------------------------------------------- Entity: target-- File: target.vhd-- Author: Jiri Gaisler - ESA/ESTEC-- Description: LEON target configuration package------------------------------------------------------------------------------library IEEE;use IEEE.std_logic_1164.all;package target istype targettechs is (gen, virtex, atc35);type syntools is (synplify, leonardo); -- synthesis tools type boottype is (memory, prom, icache);type multypes is (none, iterative); -- multiplier type : none or slow iterativetype fputype is (none, meiko, fpc); -- FPU typetype cptype is (none, cpc); -- CP typetype pcitype is (none, insilicon, estec, ahbtst); -- PCI core typetype pci_cfgclk_type is (mainclk, pciclk, both); -- clock source for PCI config write-- synthesis configurationtype syn_config_type is record syntool : syntools; targettech : targettechs; infer_ram : boolean; -- infer cache ram automatically infer_regf : boolean; -- infer regfile automatically infer_rom : boolean; -- infer boot prom automatically infer_pads : boolean; -- infer pads automatically gatedclk : boolean; -- select clocking strategy rfsyncrd : boolean; -- synchronous register-file read port rfsyncwr : boolean; -- synchronous register-file write portend record;-- processor configurationtype iu_config_type is record nwindows : integer; -- # register windows (2 - 32) multiplier : multypes; -- multiplier type fpuen : integer range 0 to 1; -- FPU enable (integer due to synopsys limitations....sigh!) cpen : boolean; -- co-processor enable fastjump : boolean; -- enable fast jump address generation icchold : boolean; -- enable fast branch logic lddelay : integer range 1 to 2; -- # load delay cycles (1-2) fastdecode : boolean; -- optimise instruction decoding (FPGA only) impl : integer range 0 to 15; -- IU implementation ID version : integer range 0 to 15; -- IU version IDend record;-- FPU configurationtype fpu_config_type is record fpu : fputype; -- FPU type fregs : integer; -- 32 for internal meiko, 0 for external FPC version : integer range 0 to 7; -- FPU version IDend record;-- co-processor configurationtype cp_config_type is record cp : cptype; -- Co-processor type version : integer range 0 to 7; -- CP version ID-- add your CP-specific configuration options here!!end record;-- cache configurationtype cache_config_type is record icachesize : integer; -- size of I-cache in Kbytes ilinesize : integer; -- # words per I-cache line dcachesize : integer; -- size of D-cache in Kbytes dlinesize : integer; -- # words per D-cache line bootcache : boolean; -- boot from cache (Xilinx only) end record;-- memory controller configurationtype mctrl_config_type is record bus8en : boolean; -- enable 8-bit bus operation bus16en : boolean; -- enable 16-bit bus operation rawaddr : boolean; -- enable unlatched address optionend record;type boot_config_type is record boot : boottype; -- select boot source promabits : integer range 1 to 26;-- boot prom address bits ramrws : integer range 0 to 3; -- ram read waitstates ramwws : integer range 0 to 3; -- ram write waitstates sysclk : integer; -- cpu clock baud : positive; -- UART baud rate extbaud : boolean; -- use external baud rate settingend record;-- PCI configurationtype pci_config_type is record pcicore : pcitype; -- PCI core type cfgclk : pci_cfgclk_type; -- Selects clock source for PCI config writes ahbmasters : integer; -- number of ahb master interfaces ahbslaves : integer; -- number of ahb slave interfacesend record;-- debug configurationtype debug_config_type is record enable : boolean; -- enable debug port uart : boolean; -- enable fast uart data to console iureg : boolean; -- enable tracing of iu register writes fpureg : boolean; -- enable tracing of fpu register writes nohalt : boolean; -- dont halt on error pclow : integer; -- set to 2 for synthesis, 0 for debugend record;-- AMBA configuration typesconstant AHB_MST_MAX : integer := 4; -- maximum AHB mastersconstant AHB_SLV_MAX : integer := 7; -- maximum AHB slavesconstant AHB_SLV_ADDR_MSB : integer := 4; -- MSB address bits to decode slavesconstant AHB_CACHE_MAX : integer := 4; -- maximum cacheability rangesconstant AHB_CACHE_ADDR_MSB : integer := 3; -- MSB address bits to decode cacheabilitysubtype ahb_range_addr_type is std_logic_vector(AHB_SLV_ADDR_MSB-1 downto 0);subtype ahb_cache_addr_type is std_logic_vector(AHB_CACHE_ADDR_MSB-1 downto 0);type ahb_slv_config_type is record firstaddr : ahb_range_addr_type; lastaddr : ahb_range_addr_type; index : integer range 0 to AHB_SLV_MAX-1; split : boolean; enable : boolean;end record;type ahb_slv_config_vector is array (Natural Range <> ) of ahb_slv_config_type;constant ahb_slv_config_void : ahb_slv_config_type := ((others => '0'), (others => '0'), 0, false, false);type ahb_cache_config_type is record firstaddr : ahb_cache_addr_type; lastaddr : ahb_cache_addr_type;end record;type ahb_cache_config_vector is array (Natural Range <> ) of ahb_cache_config_type;constant ahb_cache_config_void : ahb_cache_config_type := ((others => '0'), (others => '0'));type ahb_config_type is record masters : integer range 1 to AHB_MST_MAX; defmst : integer range 0 to AHB_MST_MAX-1; split : boolean; -- add support for SPLIT reponse slvtable : ahb_slv_config_vector(0 to AHB_SLV_MAX-1); cachetable : ahb_cache_config_vector(0 to AHB_CACHE_MAX-1);end record;constant APB_SLV_MAX : integer := 16; -- maximum APB slavesconstant APB_SLV_ADDR_BITS : integer := 10; -- address bits to decode APB slavessubtype apb_range_addr_type is std_logic_vector(APB_SLV_ADDR_BITS-1 downto 0);type apb_slv_config_type is record firstaddr : apb_range_addr_type; lastaddr : apb_range_addr_type; index : integer; enable : boolean;end record;type apb_slv_config_vector is array (Natural Range <> ) of apb_slv_config_type;constant apb_slv_config_void : apb_slv_config_type := ((others => '0'), (others => '0'), 0, false);type apb_config_type is record table : apb_slv_config_vector(0 to APB_SLV_MAX-1);end record;type peri_config_type is record cfgreg : boolean; -- enable LEON configuration register ahbstat : boolean; -- enable AHB status register wprot : boolean; -- enable RAM write-protection unit wdog : boolean; -- enable watchdogend record;-- complete configuration record typetype config_type is record synthesis : syn_config_type; iu : iu_config_type; fpu : fpu_config_type; cp : cp_config_type; cache : cache_config_type; ahb : ahb_config_type; apb : apb_config_type; mctrl : mctrl_config_type; boot : boot_config_type; debug : debug_config_type; pci : pci_config_type; peri : peri_config_type;end record;------------------------------------------------------------------------------ Synthesis configurations----------------------------------------------------------------------------constant syn_none : syn_config_type := ( syntool => synplify, targettech => gen, infer_pads => true, infer_ram => false, infer_regf => false, infer_rom => false, gatedclk => false, rfsyncrd => true, rfsyncwr => true);constant syn_atc35 : syn_config_type := ( syntool => synplify, targettech => atc35, infer_pads => false, infer_ram => false, infer_regf => false, infer_rom => true, gatedclk => false, rfsyncrd => true, rfsyncwr => true);constant syn_synplify : syn_config_type := ( syntool => synplify, targettech => gen, infer_pads => true, infer_ram => true, infer_regf => true, infer_rom => true, gatedclk => false, rfsyncrd => true, rfsyncwr => true);constant syn_synplify_vprom : syn_config_type := ( syntool => synplify, targettech => gen, infer_pads => true, infer_ram => true, infer_regf => true, infer_rom => false, gatedclk => false, rfsyncrd => true, rfsyncwr => true);constant syn_leonardo : syn_config_type := ( syntool => leonardo, targettech => gen, infer_pads => true, infer_ram => true, infer_regf => true, infer_rom => true, gatedclk => false, rfsyncrd => true, rfsyncwr => true);constant syn_virtex : syn_config_type := ( syntool => synplify, targettech => virtex, infer_pads => true, infer_ram => false, infer_regf => false, infer_rom => true, gatedclk => false, rfsyncrd => true, rfsyncwr => true);constant syn_virtex_vprom : syn_config_type := ( syntool => synplify, targettech => virtex, infer_pads => true, infer_ram => false, infer_regf => false, infer_rom => false, gatedclk => false, rfsyncrd => true, rfsyncwr => true);------------------------------------------------------------------------------ IU configurations----------------------------------------------------------------------------constant iu_std : iu_config_type := ( nwindows => 8, multiplier => iterative, fpuen => 0, cpen => false, fastjump => false, icchold => false, lddelay => 1, fastdecode => false, impl => 0, version => 0);constant iu_fpga : iu_config_type := ( nwindows => 8, multiplier => none, fpuen => 0, cpen => false, fastjump => true, icchold => true, lddelay => 1, fastdecode => true, impl => 0, version => 0);------------------------------------------------------------------------------ FPU configurations----------------------------------------------------------------------------constant fpu_none : fpu_config_type := (fpu => none, fregs => 0, version => 0);constant fpu_meiko: fpu_config_type := (fpu => meiko, fregs => 32, version => 0);constant fpu_fpc : fpu_config_type := (fpu => fpc, fregs => 0, version => 0);------------------------------------------------------------------------------ CP configurations----------------------------------------------------------------------------constant cp_none : cp_config_type := (cp => none, version => 0);constant cp_cpc : cp_config_type := (cp => cpc, version => 0);------------------------------------------------------------------------------ cache configurations
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?