在 FPGA 板上实现的可配置处理器
对于一个大学中期项目,我必须设计一个可配置处理器,用 VHDL 编写代码,然后在 Digilent 的 Spartan 3E FPGA 板上综合它。 我是初学者,所以您能给我一些有关可配置处理器的信息以及与该概念相关的一些想法吗?
For a university mid-term project I have to design a configurable processor, to write the code in VHDL and then synthesize it on a Spartan 3E FPGA board from Digilent. I'm a beginner so could you point me to some information about configurable processors, to some ideas related to the concept?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我做了一个类似的项目,用 VHDL 实现了一个具有 5 级流水线的处理器。
首先,您必须了解处理器工作的架构。 如果不了解每个阶段的作用以及您需要什么样的控制信号,您就不可能真正用 VHDL 编写一个阶段。
其次,开始绘制指令和数据如何流经处理器(即每个阶段)的图表。 每个阶段如何相互连接? 控制信号去哪里? 我的输入从哪里来,我的输出又去哪里?
一旦有了可靠的图表,VHDL 中的实际实现应该相对简单。 您可以使用 VHDL 的行为建模来从本质上准确地解释您在图中看到的内容。
I did a similar project, implementing a processor with a 5-stage pipeline in VHDL.
First things first, you have to understand the architecture of how processors work. Without understand what each stange is doing and what kind of control signals you need you've got no hope of actually writing one in VHDL.
Secondly, start drawing diagrams of how instructions and data will flow through your processor (i.e. through each stage). How is each stage hooked up to each other? Where do the control signals go? Where do my inputs come from and where do my outputs go?
Once you have a solid diagram, the actual implementation in VHDL should be relatively straightforward. You can use VHDL's behaviorial modelling to essetially explain exactly what you see in the diagram.
这只是一个模型,所以请注意我会清理它
获取指令1,
获取指令2,获取数据1
获取指令3,获取数据2,处理数据1
获取指令4,获取数据3,处理数据2,存储1数据1
获取指令5、获取数据4、处理数据3、存储2数据1
获取指令6、获取数据5、处理数据4、存储3数据1
获取指令7、获取数据6、处理数据5、存储4数据1
fetch instruct8, fetch datas7, process datas6, store5 datas1
基本上这些是处理器的主要组件
第1部分
ALU:算术逻辑单元(这是 draing 派上用场的地方)
ALU 有 2 个输入端口和一个输出端口。 对 2 个输入端口进行操作并输出结果。 为了知道 ALU 必须完成哪条指令,有一个控制端口。
基本上这是命令的名称。 因此,如果控制端口有 4 位,则有 16 条可能的指令。
第2部分
寄存器单元:这是一组存储单元(高速缓冲存储器)。 该存储器的内容通常被传输到 ALU 的输入端口。
第三部分
控制单元:这有点像 CPU 的管弦乐队主控。 它的工作是
1将数据发送至ALU输入
2读取指令寄存器中需要发生哪条指令,将这些代码发送到ALU控制端口
接口。 这就是 RAM 和其他外设与 cpu 通信的方式。
每次指令输出结果时,都必须存储它。 它可以存储在 RAM 中,因此一旦结果准备好,RAM 写入就必须准备好。 同时,可以对下一条指令的输入进行RAM读取。同时,可以从RAM中取出下一条指令。
生成1条指令通常需要1个以上的时钟周期。 指令的处理类似于工业生产。 这样链条工作就完成了。
VLIW 我们编写的编程是线性的,这意味着指令一个接一个地发生。 但如今的 CPU(尽管不是 ARM)具有多个 ALU,因此可以同时处理多个指令。
所以你有处理单元同时处理多个指令(管道)
并且你有很多这些单元(超标量),
然后就变成了一个问题:可以/需要做什么来泰勒你的CPU架构。
This is just a mockup so please be aware i will clean it up
fetch instruct1,
fetch instruct2, fetch datas1
fetch instruct3, fetch datas2, process datas1
fetch instruct4, fetch datas3, process datas2, store1 datas1
fetch instruct5, fetch datas4, process datas3, store2 datas1
fetch instruct6, fetch datas5, process datas4, store3 datas1
fetch instruct7, fetch datas6, process datas5, store4 datas1
fetch instruct8, fetch datas7, process datas6, store5 datas1
basically these are the main components of a processor
Part 1
ALU: Arithmetic Logic Unit (this is where draeing would come in handy)
AN ALU has 2 input ports and an output port. THe 2 input ports get operated on and the result outputed. To know which instruction the ALU has to accomplish there is a control Port.
Basically this is the name of the command. So if the control port has 4bits there are 16 possible instructions.
Part 2
REGISTER UNIT: This is a set of memory cells (cache memory). The contents of this memory is often transferred to the ALU's input ports.
Part3
Control Unit: This is sort of like the orchestra master of the cpu. Its job is to
1send the data to the ALU input
2Readwhich instruction needs to happen in the Instruction Registers,send those codes to the ALU control ports
Interface. This is how the RAM and other peripherals communicate with the cpu
Everytime the intruction outputs a result it has to be stored. It can be stored in RAM so a ram write must be ready once the result is ready. At the same time, a RAM read of the next instruction's inputs can occurs.And also at the same time, the next next instruction can be fetched from RAM.
Generating 1 instruction usually requires more than 1 clock cycle. Processing an in struction is analogeous to industrial production. So chain work is done.
VLIW The programming we write is linear, meaning instructions happening one after the other. But CPUs today (not ARMs though) have multiple ALU's so multiple instructions are processed at the same time.
So you have processing units chain working multiple instructions at the same time (pipeline)
and you have alot of those units (superscalar)
It then becomes a question of what can/need to do to taylor your cpu architecture.
您可以查看我的相关问题的答案 。 我们做了几乎相同的事情,用 VHDL 为 FPGA 板构建了 CPU。
You can check out my answer for a related question. We did nearly the same, building a CPU in VHDL for a FPGA board.