简体   繁体   English

一站式手臂指令

[英]One Bus Instructions for Arm Instructions

I am currently trying figure out one instructions given each clock cycle using an ARM processor. 我目前正在尝试使用ARM处理器在每个时钟周期给出一个指令。 I have been introduced to these concepts twice now and have yet to find anyone who teaches it properly. 现在已经两次向我介绍了这些概念,但还没有找到合适的人来教它。 Currently I am trying to figure out the instructions: 目前,我正在尝试找出说明:

1). 1)。 LSR R0, R1, #2; LSR R0,R1,#2; 2). 2)。 cmp R5, R6; cmp R5,R6;

and I need to determine the machine code and then schedule the above instructions on the one bus machine. 我需要确定机器代码,然后将上述说明安排在一台总线机器上。

Any help is appreciated! 任何帮助表示赞赏!

Machine Code 机器码

The ARM Architecture Reference Manual specifies the machine code for instructions. 《 ARM体系结构参考手册 》为指令指定了机器代码。 Page A7-68 describes the format for an LSR instruction with an immediate input. A7-68页描述了带有立即输入的LSR指令的格式。

//I can't post an image because of low reputation
Bit - 15 14 13 12 11 | 10           6 | 5     3 | 2     0
Val -  0  0  0  0  1 |     immed_5    |    Rm   |   Rd

Syntax
LSR <Rd>, <Rm>, #<immed_5>
where:
<Rd> Is the destination register for the operation.
<Rm> Is the register containing the value to be shifted.
<immed_5> Specifies the shift amount, in the range 1 to 32. 
Shifts by 1 to 31 are encoded directly in immed_5.
A shift by 32 is encoded as immed_5 == 0.

With your instruction, immed_5 = 00010, Rm = 001, and Rd = 000 根据您的指令, immed_5 = 00010, Rm = 001, and Rd = 000

So the binary instruction is: 00001 00010 001 000 因此二进制指令为: 00001 00010 001 000

or in hex: 0x0111 . 或以十六进制表示: 0x0111


One Bus Scheduling 一辆巴士的调度

To goal of scheduling an instruction on a one bus machine is to specify which registers are putting data on the bus, which registers are reading data from the bus, and in what order this should occur. 为了在一个总线机器上调度一条指令,目标是指定哪些寄存器将数据放到总线上,哪些寄存器从总线上读取数据,以及应该以什么顺序发生。 An important thing to remember is that only one value should be put on the bus at a time. 要记住的重要一点是,一次只能在总线上输入一个值。

Here is an example scheduling using your first instruction. 这是使用您的第一条指令进行调度的示例。 This uses X as an ALU input register, and Y as an ALU output register. 这使用X作为ALU输入寄存器,使用Y作为ALU输出寄存器。 This also assumes ALUsll will left shift the value on the bus by the value stored in X. 这也假设ALUsll将总线上的值左移X中存储的值。

LSR R0,R1,#2 LSR R0,R1,#2

Get the instruction into the Instruction Register 将指令放入指令寄存器

  1. PCout, MARin, MEMread PCout,MARin,MEMread
    Access memory location of current instruction 访问当前指令的存储器位置
  2. MDRlatch MDRlatch
    Load the value from memory into MDR 将值从内存加载到MDR
  3. MDRout, IRin MDRout,IRin
    Let the instruction into instruction register 让指令进入指令寄存器

Perform instruction specific operations 执行指令特定的操作

  1. IRimmediateout, Xin 即时通讯,辛
    Put the immediate value (#2) from the instruction into X 将指令中的立即数(#2)放入X
  2. R1out, ALUsll, Yin R1out,ALUsll,Yin
    Put the value from R1 on the bus, tell the ALU to shift, and store the result in Y 将R1中的值放在总线上,告诉ALU移位,并将结果存储在Y中
  3. Yout, R0in Store the result into R0 Yout,R0in将结果存储到R0中

Advance the PC for the next instruction 前进PC以获得下一条指令

  1. PCout, SetXto2, ALUadd, Yin PCout,SetXto2,ALUadd,Yin
  2. Yout, PCin PCin Yout

You can use these same methods to determine the machine code translation and one-bus scheduling of any other ARM instruction. 您可以使用这些相同的方法来确定机器代码转换和任何其他ARM指令的单总线调度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM