登录

  • 登录
  • 忘记密码?点击找回

注册

  • 获取手机验证码 60
  • 注册

找回密码

  • 获取手机验证码60
  • 找回
毕业论文网 > 外文翻译 > 电子信息类 > 电子信息工程 > 正文

RISC架构外文翻译资料

 2023-06-15 05:06  

附录B 外文原文

RISC Architecture

Core: ARMs CortexTM-M3 core with embedded Flash and SRAM

ARMs CortexTM -M3 processor is the latest generation of embedded ARM processors, providing the low-cost platform, reduced pin count, and reduced system power needed to implement MCUs while providing superior computational performance and advanced interrupt system response. ARMs CortexTM -M3 is a 32-bit RISC processor, providing additional code efficiency that It leverages the high performance of ARM cores on the memory space typically available in 8 and 16-bit systems.

Translated with www.DeepL.com/Translator (free version)

Features of RISC architecture.

Performance feature one: A large number of registers are used, so that most of the instruction operations are performed between registers, increasing the processing speed;

Performance feature 2: Due to the simplified instruction set, pipeline and common instructions are available for hardware execution;

Performance feature three: the use of cache-host-external memory three-level storage structure, so that the fetch and store instructions are executed separately, so that the processor can complete as much work as possible, and does not slow down the processing speed due to accessing information from memory.

RISC Instruction Set

The instruction set is divided into a basic part, where all hardware implementations of the instruction set must have this part implemented, and an extended part, which is optional. The extensions are divided into standard extensions and non-standard extensions. For example, multiplication and division, single and double precision floating point, and atomic operations are in the standard extension subset.

emsp;'I' The basic integer set, which contains the basic computation, Load/Store, and control flow of integers, must be included in all hardware implementations.

Translated with www.DeepL.com/Translator (free version)

'M' The standard integer multiplication and division extension set, which adds multiplication and division instructions in the integer registers.

emsp;'A' Standard operation atomic extension set, adding atomic reads, writes, modifications to the store and interprocessor synchronization.

emsp;'F' Standard single-precision floating-point extension set, adding floating-point registers, compute instructions, and L/S instructions.

emsp;'D' Standard double-precision extension set, extending double-precision floating-point registers, double-precision compute instructions, and L/S instructions.

emsp;I M F A D is abbreviated as 'G' and together they form the general-purpose scalar instructions.

The RV32G and RV64G always remain the same during subsequent iterations of the ISA.

emsp;emsp;The basic RISC-V ISA has a 32-bit fixed length and requires 32-bit address alignment. However, variable length extensions are also supported, requiring 16-bit integer multiples of the instruction length and 16-bit address alignment.

emsp;emsp;The lowest 2 bits of a 32-bit instruction are '11', while a 16-bit variable-length instruction can be '00, 01, 10', the lower 5 bits of a 48-bit instruction are all 1s, and the lower 6 bits of a 64-bit instruction are all 1s. The former jumps into a memory area filled with zeros, and the latter usually means that the bus or memory is corrupted.

emsp;emsp;In addition, RISC-V uses a small-ended storage system by default, but can support large-ended or double-ended storage systems in non-standard variants.

Translated with www.DeepL.com/Translator (free version)

RISC instruction set features

  • Configurable general-purpose register sets.
  • Simple memory access instructions.
  • efficient branch-jump instructions.
  • concise subroutine calls.
  • unconditional code execution.
  • branchless delay slots.
  • simple arithmetic instructions.

USB protocol design and implementation on RISC processors.

The design and implementation of the USB protocol on the STM32 processor is based on a layered design architecture, both in the design and implementation of the CDC standard device class and later in the design of the device class based on its own communication characteristics, which facilitates the porting of the program because the underlying hardware is the same, so the underlying program, i.e., the hardware abstraction layer, does not need to be changed when developing on the two device classes. Only the application layer program implements some specific functions and changes some characteristics according to the specific functions. Therefore, the software design of the two device classes does not need to be changed very much.

The USB library is divided into two layers: the USB library core layer: communicates directly with the USB hardware and is compatible with the USB2.0 specification. It is a separate library from the STM32F firmware library. The application interface layer provides an interface for user applications to interact with the underlying USB library core.

Definition of system source files

Core modules: (1) USB type

(1) USB type.h This file defines the main data types used in the library. These data types are dependent on the processor being used.

(2) usb_reg(.e..h) The usb_ regs module implements the abstraction layer of the hardware, and this file provides the base addresses and offsets of the various functional modules within the USB hardware in macro definitions.

(3) usb-int(.c,.h) The usb-int module provides the interrupt handler routine when the correct data is transferred, and provides the final interrupt handling code.

(4) usb_core(.c,.h) The usb-core module is the core of this library and implements all function requests.

  • The GETSTATUS request is used by the host to read the status of a device, inte

    剩余内容已隐藏,支付完成后下载完整资料


    附录A 译文

    RISC架构

    内核:ARM的CortexTM -M3校心并内嵌闪存和 SRAM ARM 的 CortexTM -M3处理器是最新一代的嵌入式 ARM 处理器,它为实现 MCU 的需要提供了低成本的平台、缩减的引脚数目、降低的系统功耗,同时提供卓越的计算性能和先进的中断系统响应。ARM 的 CortexTM -M3是32位的 RISC 处理器,提供额外的代码效率,在通常8和16位系统的存储空间上发挥了 ARM 内核的高性能。

    RISC架构的特点:

    性能特点一:采用大量的寄存器,使大部分指令操作都在寄存器之间进行,提高了处理速度;

    性能特点二:由于指令集简化后,流水线以及常用指令均可用硬件执行;

    性能特点三:采用缓存—主机—外存三级存储结构,使取数与存数指令分开执行,使处理器可以完成尽可能多的工作,且不因从存储器存取信息而放慢处理速度。

    RISC指令集

    指令集分为基本部分和扩展部分,基本部分的指令集所有硬件实现都必须有这一部分实现,而扩展部分则是可选的。扩展部分又分为标准扩展和非标准扩展。例如,乘除法、单双精度的浮点、原子操作就在标准扩展子集中。

    emsp;“I” 基本整数集,其中包含整数的基本计算、Load/Store和控制流,所有的硬件实现都必须包含这一部分。

    emsp;“M” 标准整数乘除法扩展集,增加了整数寄存器中的乘除法指令。

    emsp;“A” 标准操作原子扩展集,增加对储存器的原子读、写、修改和处理器间的同步。

    emsp;“F” 标准单精度浮点扩展集,增加了浮点寄存器、计算指令、L/S指令。

    emsp;“D” 标准双精度扩展集,扩展双精度浮点寄存器,双精度计算指令、L/S指令。

    emsp;I M F A D 被缩写为 “G” ,共同组成通用的标量指令。

    在后续ISA的版本迭代过程中,RV32G和RV64G总是保持不变。

    emsp;emsp;基本RISC-V ISA具有32位固定长度,并且需要32位地址对齐。但是也支持变长扩展,要求指令长度为16位整数倍,16位地址对齐。

    emsp;emsp;32位指令最低2位为“11”,而16位变长指令可以是“00、01、10”,48位指令低5位位全1,64位指令低6位全1。任何长度的指令,如果所有位全0或全1,都认为是非法指令,前者跳入填满0的储存区域,后者通常意味着总线或储存器损坏。

    emsp;emsp;另外,RISC-V默认用小端储存系统,但非标准变种中可以支持大端或者双端储存系统。

    RISC指令集特点

    • 可配置的通用寄存器组;
    • 简洁的存储器访问指令;
    • 高效的分支跳转指令;
    • 简洁的子程序调用;
    • 无条件码执行;
    • 无分支延迟槽;
    • 简洁的运算指令;

    RISC处理 器 上 USB协 议设计与 实现

    STM32处理 器 上 USB协 议 设 计 与 实现 不论是在进行 CDC标准设备类 的设计实现还是后来 进行 的根据 自己的通信特点设 计的设备类 ,都 是采用 了分层 的设 计架构 ,这 样便 于程序 的移植开 发 ,因为底层 的硬 件都是一样 的 ,所以在这两个 设备 类上开发时底层的程序 即硬件抽象层程序不需要改变 ,只是应 用层的 程序根据具体的功能来实现 了一些具体 的函数改变 了一些 特性 .所以 在两个设备类进行软件设计时改动并不是很大 。

    USB的库被分成了两层 : USB库核心层 :直接和 USB的硬件进行通信 ,并且兼容 USB2.0 的规 范.是从 STM32F固件库中分离 出来 的库 。 应用程序接 口层 :为用户应 用程 序提供和底层 的 USB库核心进行交互的接口。

    系统源文件的定义

    核心模块:

    1. USb_type.h 这个 文件定 义了库 中主要使用 的数据类型 .这些数据类 型依赖 于 所使用的处理器 。
    2. usb_reg(.e..h) usb_ regs模块实现 了硬件 的抽 象层 ,该文件 以宏定 义的方式提供 了 USB硬件 内部各个功能模块 的基地址和偏移量 。
    3. usb—int(.c,.h) usb— int模 块提供 了当有正 确 的数 据传 输过 来时 的 中断处 理例 程 ,该模块提供 了最终 的中断处理代码。
    4. usb_core(.c,.h) usb— core模块 是编写的这个库的核心 ,实现 了所有 的功能请求的 函数 。
    • GETSTATUS请求用 于主机 读取设备 、接 口或端点的状 态。
    • CLEAR_FEATURE请求用 于清除或禁止设备 、接 口或端点的 某些特性 。该请求无数据阶段。
    • SET_FEATURE请 求用于设置 或使 能设备 、接 口或端点 的某 些特性 .它与 CLEAR_FEATURE请 求相对应 。该请求无数据阶段。
    • SET_ADDRESS请求用于为 USB设备分配一个 唯一的设 备地 址 。
    • GET_DESCRIPTOR请求用 于主机读取指定的描述符 。 GET_ DESCRIPTOR请求 仅支持三种类型的描述符 :设备描述 符 、 配置描述符和字符串描述 符。
    • SET_DESCRIPT OR请求 用于更新 USB设备 已有 的描述符或 向其添加新的描述符。
    • GET_CONFIGURATION请 求用 于主机读 取 USB设 备当前 的 配置值。
    • SET_CONFIGURATION请 求用 于为 USB设备选 择一 个合适 的 配 置 。
    • GET_INTERFACE请求用于主机读取 指定接 口的 当前可替换 设置值 ,即其接 13描述符中 bAlternateSetting字段的值。
    • SET_INTERFACE请求用 于为指定接 1=I选择一个合适 的可替 换 设置。

    应用程序接口模块

    1. usb—istr(.e) 在 usb_istr模块 编写了一个 函数 USB—Istr(),用来从宏 观上处理 中断 ,判断是 哪种中断类型 ,然后调用相应的中断处理函数。
    2. usb_conf(.h) usb_ conf.h文件是用来定义 BTABLE(USB通信过程中用于发送数 据的缓冲表)和所 有节点在 PMA中的地 址 ;并且在这个文件 中定义 了 中断掩码来规定 哪些 中断 可以开启那些 中断关闭。
    3. usb__endp(.C) usb— endp模块 定义 了除端 点 0(EP0)以外 的所有 其余 7个 端点 的中断回调 函数 ,这个 函数对应的是在有数据正确传输时产生的 中断 对 应 的处 理 。
    4. usb prop (.C,.h) usb_ prop模块 用来定义在 usb_core模块 中各个 标准响应 函数用 到 的数据结构如 Deviee_Propety、USER_STANDARD—REQUEST等。
    5. usbpwr(ie,.h) 这个模块用于管理 USB设备的 电源问题。总共编写 了四个函数 :
    • Power_on0:在设备 电源打开时进行的相应中断处理
    • Power_of0:在设备电源关闭时进行的相应 中断处理
    • Suspend0:在设备挂起时进行的相应中断处理
    • Resume0:在设备唤醒时进行 的相应 中断处理 6)usbdesc(.e,.h) 这个文件 中包含了所有的 USB描述符 ,根据我的设备特点定义了所有的设备描述符 。

    寄存器CRL

    该寄存器的复位值为 0X4444 4444,从图 6.1.1 可以看到,复位值其实就是配置端口为浮空输入模式。从上图还可以得出:STM32 的 CRL 控制着每组 IO 端口(A~G)的低 8 位的模式。

    每个 IO 端口的位占用 CRL 的 4 个位,高两位为 CNF,低两位为 MODE。这里我们可以记住几 个常用的配置,比如 0X0 表示模拟输入模式(ADC 用)、0X3 表示推挽输出模式(做输出口用, 50M 速率)、0X8 表示上/下拉输入模式(做输入口用)、0XB 表示复用输出(使用 IO 口的第二 功能,50M 速率)。

    GPIOC-gt;CRHamp;=0XFFF00FFF; //清掉这 2 个位原来的设置,同时也不影响其他位的设置

    GPIOC-gt;CRH|=0X00038000; //PC11 输入,PC12 输出

    GPIOC-gt;ODR=1lt;lt;11; //PC11 上拉

    通过这 3 句话的配置,我们就设置了 PC11 为上拉输入,PC12 为推挽输出。

    IDR寄存器

    IDR 是一个端口输入数据寄存器,只用了低 16 位。该寄存器为只读寄存器,并且只能以16 位的形式读出。负责读取I/O口的状态。

    CRC计算单元

    循环冗余校验( CRC )计算单元是根据固定的生成多项式得到任一32位全字的 CRC 计算结果。在其他的应用中, CRC 技术主要应用于核实数据传输或者数据存储的正确性和完整性。标准 EN / IEC 60335-1即提供了一种核实闪存存储器完整性的方法。 CRC 计算单元可以在程序运行时

    计算出软件的标识,之后与在连接时生成的参考标识比较,然后存放在指定的存储器空间。

    CRC 主要特性

    • 使用 CRC -32(以太网)多项式:0x4C11DB7。
    • 一个32位数据寄存器用于输入/输出。
    • CRC计算时间:4个 AHB 时调期( HCLK )。
    • 通用8位寄存器(可用于存放临时数据。

    CRC 功能描述

    CRC 计算单元含有1个32位数据寄存器;

    ●对该寄存器进行写操作时,作为输入寄存器,可以输入要进行CRC计算的新数据。

    ●对该寄存器进行读操作时,返回上十次 CRC 计算的结果。

    每一次写入数据寄存器,其计算结果是前一次 CRC 计算结果和新计算结果的组合(对整个32位字进行CRC计算,而不是逐字节地计算)。

    数据寄存器(CRC-DR)

    地址偏移:0X00

    复位值:0XFFFF FFFF

    独立数据寄存器(CRC-IDR)

    地址偏移:0X04

    复位值:0X0000 00

    通用定时器

    STM3 的通用 TIMx (TIM2、TIM3、TIM4 和 TIM5)定时器功能包括:

    (1)、16 位向上、向下、向上/向下自动装载计数器(TIMx_CNT)。

    (2)、16 位可编程(可以实时修改)预分频器(TIMx_PSC),计数器时钟频率的分频系数为 1~ 65535 之间的任意数值。

    (3)、4 个独立通道(TIMx_CH1~4),这些通道可以用来作为:

    A.输入捕获

    B.输出比较

    C.PWM 生成(边缘或中间对齐模式)

    D.单脉冲模式输出

    (4)、可使用外部信号(TIMx_ETR)控制定时器和定时器互连(可以用 1 个定时器控制另外 一个定时器)的同步电路。

    (5)、如下事件发生时产生中断/DMA:

    A.更新:计数器向上溢出/向下溢出,计数器初始化(通过软件或者内部/外部触发)

    B.触发事件(计数器启动、停止、初始化或者由内部/外部触发计数)

    C.输入捕获

    D.输出比较

    E.支持针对定位的增量(正交)编码器和霍尔传感器电路

    F.触发输入作为外部时钟或者按周期的电流管理

    定时器的时钟来源有 4 个:

    (1)、内部时钟(CK_INT)

    (2)、外部时钟模式 1:外部输入脚(TIx)

    (3)、外部时钟模式 2:外部触发输入(ETR)

    (4)、内部触发输入(ITRx):使用 A 定时器作为 B 定时器的预分频器(A 为 B 提供时钟)。

    看门狗:

    STM32 的独立看门狗由内部专门的 40Khz 低速时钟驱动,即使主时钟发生故障,它也仍然有效。这里需要注意独立看门狗的时钟是一个内部 RC 时钟,所以并不是准确的 40Khz,而是在 30~60Khz 之间的一个可变化的时钟,只是我们在估算的时候,以 40Khz 的频率来计算,看门狗对时间的要求不是很精确,所以,时钟有些偏差,都是可以接受的。

    在键寄存器(IWDG_KR)中写入 0xCCCC,开始启用独立看门狗;此时计数器开始从其复位 值 0xFFF 递减计数。当计数器计数到末尾 0x000 时,会产生一个复位信号(IWDG_RESET)。 无论何时,只要键寄存器 IWDG_KR 中被写入 0xAAAA,

    IWDG_RLR 中的值就会被重新加载到 计数器中从而避免产生看门狗复位 。

    IWDG_PR 和 IWD

    剩余内容已隐藏,支付完成后下载完整资料


    资料编号:[604026],资料为PDF文档或Word文档,PDF文档可免费转换为Word

您需要先支付 30元 才能查看全部内容!立即支付

企业微信

Copyright © 2010-2022 毕业论文网 站点地图