52 Things: Number 1 : Different Types of Processors
52 件事: 数字 1 : 不同类型的处理器
This is the first in a series of blog posts to address the list of '52 Things Every PhD Student Should Know' to do Cryptography. The set of questions has been compiled to give PhD candidates a sense of what they should know by the end of their first year - and as an early warning system to advise PhD students they should get out while they still can! In any case, we will be presenting answers to each of the questions over the next year and I have been volunteered for the (dubious) honour of blogging the very first 'thing'. The first topic is on computer architecture and is presented as the following question:这是一系列博客文章中的第一篇,旨在解决“每个博士生都应该知道的 52 件事”来做密码学。这套问题已经编制,让博士生在第一年结束时了解他们应该知道什么 - 并作为一个早期预警系统,建议博士生他们应该趁着他们还能出去!无论如何,我们将在明年为每个问题提供答案,我自愿为第一个“东西”写博客的(可疑的)荣誉。第一个主题是关于计算机体系结构的,具体如下:
What is the difference between the following?There is no strict definition of a general-purpose processor, however, it is widely accepted that a processor is general if it is Turing-complete. This captures any processor that is able to compute anything actually computable (i.e. can solve any problem a Turing machine can). I will not delve into the definition of a Turing machine but if I've already lost you then I would recommend brushing up on your Theory of Computation [1]. Note though that this definition has no concept of performance or instruction-set capabilities and, in fact, some researchers have gone through the trouble of proving that you may only need a single instruction to be Turing-complete [2]. In the context of modern processors, most programmable CPUs are considered general purpose.
以下有什么区别? - A general-purpose processor.
- 通用处理器。 - A general-purpose processor with instruction-set extensions.
- 具有指令集扩展的通用处理器。 - A special-purpose processor (or co-processor).
- 专用处理器(或协处理器)。 - An FPGA. - FPGA。
通用处理器没有严格的定义,但是,人们普遍认为,如果处理器是图灵完备的,则处理器是通用的。这捕获了任何能够计算任何实际可计算内容的处理器(即可以解决图灵机可以解决的任何问题)。我不会深入研究图灵机的定义,但如果我已经失去了你,那么我建议你复习一下你的计算理论[1]。但请注意,这个定义没有性能或指令集功能的概念,事实上,一些研究人员已经费尽心思证明你可能只需要一条指令就可以达到图灵完备[2]。在现代处理器的背景下,大多数可编程 CPU 被认为是通用的。 The cost of being general-purpose usually comes at a penalty in performance. Specifically, a general-purpose processor may be able to compute anything computable but, it will never excel at complex repeated tasks. Given a task that is repeated regularly on a general-purpose processor in a wide variety of applications, a processor designer may incorporate instruction-set extensions to the base micro-architecture to accommodate the task. Functionally, there may be no difference in the micro-architecture capabilities but practically there may be huge performance gains for the end-user.
通用的成本通常以性能为代价。具体来说,通用处理器可能能够计算任何可计算的东西,但它永远不会在复杂的重复任务中表现出色。给定在各种应用中在通用处理器上定期重复的任务,处理器设计人员可以将指令集扩展合并到基本微架构中以适应该任务。从功能上讲,微架构功能可能没有区别,但实际上最终用户可能会有巨大的性能提升。 As we're all cryptographers here, I will stick to a crypto example for instruction-set extensions. Consider a desktop machine with an AES encrypted disk. Any reads from secondary storage require a CPU interrupt to decrypt the data blocks before being cached. Given disk access from a cache miss is already considered terrible, add the decryption routine over the top and you have a bottleneck worth making you re-consider your disk encryption. It should be clear here that AES is our complex repeated task and given a general-purpose CPU with a simple instruction-set, we have no choice but to implement the decryption as a linear stream operations. Intel and AMD both recognised the demand for disk encryption and the penalty AES adds to secondary storage access and have (since circa 2010) produced the AES-NI x86 instruction-set extension to accelerate disk encryption on the their line of desktop CPUs.
由于我们都是密码学家,我将坚持使用指令集扩展的加密示例。考虑使用具有 AES 加密磁盘的台式计算机。从辅助存储读取的任何数据都需要 CPU 中断来解密数据块,然后才能缓存。鉴于从缓存未命中访问磁盘已经被认为是可怕的,在顶部添加解密例程,您就会遇到一个瓶颈,让您重新考虑磁盘加密。这里应该清楚的是,AES 是我们复杂的重复任务,并且给定一个具有简单指令集的通用 CPU,我们别无选择,只能将解密实现为线性流操作。英特尔和AMD都认识到了对磁盘加密的需求以及AES对辅助存储访问的惩罚,并且(自2010年左右以来)生产了AES-NI x86指令集扩展,以加速其台式机CPU系列的磁盘加密。 If you want to fully accelerate any computation, the most optimal result will always be a special-purpose processor or an Application-specific integrated circuit (ASIC). Here we lose a significant portion of the flexibility granted by a general-purpose processor in exchange for performance gains. These types of processors are often tightly-coupled to a general-purpose processor, hence the term co-processor. Note, a co-processor may indeed be in the same package as a general-purpose processor but not necessarily integrated into the general-purpose architecture. Once again, if we turn to modern processor architectures, Intel and AMD have both integrated sound cards, graphics processors and DSP engines into their CPUs for some time now. The additional functionality is exposed via special-purpose registers and the co-processor treated as a separate component which the general-purpose processor must manage.
如果要完全加速任何计算,最佳结果始终是专用处理器或专用集成电路 (ASIC)。在这里,我们失去了通用处理器提供的很大一部分灵活性,以换取性能提升。这些类型的处理器通常与通用处理器紧密耦合,因此称为协处理器。请注意,协处理器可能确实与通用处理器位于同一封装中,但不一定集成到通用体系结构中。再一次,如果我们转向现代处理器架构,英特尔和AMD已经将声卡,图形处理器和DSP引擎集成到其CPU中已经有一段时间了。附加功能通过专用寄存器公开,协处理器被视为通用处理器必须管理的单独组件。 Finally we turn to Field-Programmable Gate Arrays (FPGAs). The middle-ground between ASIC and general-purpose processors. If an application demands high-performance throughput but also requires (infrequent) modification then an FPGA is probably the answer. To understand how an FPGA works, consider a (very) large electronics breadboard with thousands of logic-gates and lookup tables (multiplexers attached to memory) placed all around the breadboard. If you describe an application as a set of gates and timing constraints then you can wire it together on the breadboard and produce a circuit that will evaluate your application. An FPGA affords the flexibility of being re-programmable whilst producing the dedicated logic to evaluate a target application. The key difference to a general-purpose program is how you design and build your application. In order to get the most out of the hardware you must describe the application as a set of hardware components and events using a hardware description language (Verilog or VHDL). This process is frequently used to prototype general-purpose and special-purpose processors on FPGAs before production. However, it is not without its drawbacks. Designing a program with low-level building blocks becomes very cumbersome for large applications. In addition, the energy consumption and hardware costs are generally higher in comparison to a general-purpose embedded IC. Recently, FPGA manufacturer Xilinx have begun shipping FPGAs with ARM general-purpose cores integrated within a single package [3]. This now makes FPGAs available to the ARM core as a flexible co-processor. As a result, you can build dedicated logic to evaluate your crypto primitives and hence accelerate cryptographic applications.
最后,我们转向现场可编程门阵列(FPGA)。ASIC和通用处理器之间的中间地带。如果应用需要高性能吞吐量,但也需要(不频繁的)修改,那么 FPGA 可能是答案。要了解FPGA的工作原理,请考虑一个(非常)大的电子试验板,该试验板周围放置了数千个逻辑门和查找表(连接到存储器的多路复用器)。如果将应用描述为一组门和时序约束,则可以在试验板上将其连接在一起,并生成一个评估应用的电路。FPGA 提供了可重新编程的灵活性,同时产生用于评估目标应用的专用逻辑。与通用程序的主要区别在于如何设计和构建应用程序。为了充分利用硬件,必须使用硬件描述语言(Verilog 或 VHDL)将应用程序描述为一组硬件组件和事件。此过程通常用于在生产前在 FPGA 上对通用和专用处理器进行原型设计。然而,它并非没有缺点。对于大型应用程序来说,使用低级构建块设计程序变得非常麻烦。此外,与通用嵌入式IC相比,能耗和硬件成本通常更高。最近,FPGA 制造商 Xilinx 已开始出货在单个封装中集成了 ARM 通用内核的 FPGA[3]。现在,这使得 FPGA 可作为灵活的协处理器提供给 ARM 内核。因此,您可以构建专用逻辑来评估您的加密原语,从而加速加密应用程序。 In summary, general-purpose processors are capable of computing anything computable. Similarly for a general-purpose processor with instruction-set extensions and it may perform better in particular applications. A special-purpose (or co-processor) is very fast at a particular task but is unable to compute anything outside of that. An FPGA can be used to build all of the above hardware but sacrifices speed for flexibility over an ASIC solution.
总之,通用处理器能够计算任何可计算的东西。同样,对于具有指令集扩展的通用处理器,它可能在特定应用中性能更好。专用(或协处理器)在特定任务中非常快,但无法计算超出此目的的任何内容。FPGA 可用于构建上述所有硬件,但与 ASIC 解决方案相比,为了灵活性而牺牲了速度。 标签:Different,通用,Processors,FPGA,Things,general,purpose,processor,处理器 From: https://www.cnblogs.com/3cH0-Nu1L/p/18104641