3

I have programming background, and I recently started taking computer architecture course. Most of the lectures I see use the some sort of the layering as described in the following diagram explaining what will be covered in the course.

enter image description here

The question here is compiler (System software) takes care of converting high level/assembly code to machine code that can be understood by the processor. OS executes this code by managing the resources such as processor scheduling, memory management etc.. so what's the role of ISA layer here

  1. What is the input interface to this layer (Machine code from OS)?
  2. What is the output interface to this layer?

Image courtesy: http://theembeddedguy.com/2016/05/15/layers-of-abstraction/

Vivek Maran
  • 379
  • 1
  • 4
  • 12
  • 1
    That isn't really a meaningful question, just as asking what the input and output to the "algorithm" or "physics" blocks in your chart would't really be meaningful questions. – Chris Stratton Feb 03 '18 at 21:37
  • Why not :) ? That' s how any block (or) software (or) system is designed isn't it? We have to know to input specifications and output specifications to understand the system /software /layer. May be this can be rephrased as what is the role of ISA? – Vivek Maran Feb 03 '18 at 21:41
  • The ISA is somewhat more intangible than the other layers of this cake. The term "ISA" is usually associated with the idea that the instruction set is a relatively stable specification of the interface between hardware and software. The hardware microarchitecture is able to process "directly" machine code. The ISA (current popular ones are ARM and x86) defines how different microarchitectures could be compatible (ex. AMD Zen and Intel SkyLake) and different software (ex. GCC and Microsoft compilers, Linux and Windows). This is only a partial view, there are many things needed around CPUs. – TEMLIB Feb 03 '18 at 23:05
  • You should look at examples : "ARM architecture reference manual" or "Intel 64 and IA-32 software developers manual", "Power ISA™","M68000PRM"... Imagine making a compiler targeting these instructions, imagine making a CPU implementing these instructions. – TEMLIB Feb 03 '18 at 23:47
  • There are many ways to partition the workings of a computing system. In a way presented by theembeddedguy.com, it has full explanation of what they mean in the particular diagram. I feel that the question is inspired by goofy on-line MIT lectures that convert everything into "inputs" and "outputs". – Ale..chenski Feb 03 '18 at 23:53
  • What are the inputs and outputs of a programming language? For that matter what are the inputs and outputs of a building architecture? – user253751 Feb 05 '18 at 01:17
  • Consider the RTL level (register-transfer-level) as what you want. – analogsystemsrf Feb 05 '18 at 06:44

3 Answers3

4

The ISA is the level which a compiler targets (although optimisations are sensitive to the micro-architecture, particularly in terms of optimum scheduling). The ISA is a simplified but sufficient definition of the hardware interface.

The ISA describes the abstract behaviour of the underlying compute engine, and what the fundamental operations that can be encoded in machine code instructions. It will define what sort of registers the processor has, how they interact with memory, and what arithmetic operations are possible.

The ISA can also influence how easy it is to optimise the implementation (for example long pipelines, or wide issue), and may implement features which are intended to target specific high level languages (or simplify a compiler's task).

Along with the ISA, there will be architectural guarantees of ordering, exceptions, power control and access controls which also define the processor architecture. These are not relevant to a compiler (and frequently require intrinsics to access), but are critical to an OS (and sometimes applications).

Your diagram is a misleading abstraction, although each element is distinct, they don't interface to each other in the same way as a software stack would. Micro-architecture is for example influenced by feature size - both in terms of timing and costs - the gate level view is what designers think of when of when working on micro-arch).

To give a high level example of what an ISA is, consider how a fixed-length 32 bit instruction might be split up.

4 bits for instruction type (Load/Store, ALU, etc) 4 bits for instruction operation (Add/Sub, or addressing mode) 4 bits for operand 1 register 4 bits for operand 2 register 4 bits for destination register 4 bits for flow control 4 bits for constant input (e.g. operand shift) 4 more bits specific to the instruction

You would want to map these onto some superset of the functions you need for an efficient turing machine. Thus the ISA describes precisely what the machine code and assembly code represent (in a more-or-less 1:1 relation). Some instructions (NOP being the obvious example) can be achieved using a custom opcode, or a A=A|A type instruction if symmetry permits these.

In reference to the source of the diagram, in computer architecture, the micro-architecture would not generally be used to refer to the RAM, ROM and timers in a microcontroller. It would refer to how integer divide is implemented, how many instructions can execute per cycle, how many loads can be outstanding at a time - the sort of detail that is hard to observe in software at all.

Sean Houlihane
  • 3,733
  • 1
  • 16
  • 25
  • At a high level, can I take ISA as a some sort of specification which helps compiler decide what sort of machine code that the compiler has to generate. OS schedules this (machine code programs) into processors which is in turn gets executed. Is my understanding correct? – Vivek Maran Feb 03 '18 at 23:20
  • 1
    No, That isn't wrong, but it's not helpful either. ALL code (os or application) is a peer at the ISA level, and is expressed identically. OS may have privilege to access memory permissions, but that is outside of the ISA. – Sean Houlihane Feb 03 '18 at 23:37
  • Thanks, at-least am thinking am going in the right track of understanding. ISA is the hardware interface specification (defines how to use processor and other associated resources). Be it OS, or any other program all adhere to this and gets executed in the processor (as peers). It's just the OS does process management, and many other. User program is specific to application. Hopefully this is the correct version of understanding. Sorry if am wrong again ( I am new to this) :) – Vivek Maran Feb 03 '18 at 23:49
  • 1
    Yes, the ISA does exactly define the hardware interface, for a subset of features (depending on the use of the term). The definition has no subtlety though, so doesn't show how to best use the hardware. – Sean Houlihane Feb 03 '18 at 23:54
  • Okay thanks many lectures place that in a stack diagram and which is what made me to get confused a bit. – Vivek Maran Feb 03 '18 at 23:56
  • Lots of lectures seem to have been written in about 1985, and not updated substantively since... – Sean Houlihane Feb 03 '18 at 23:57
  • 1
    @SeanHoulihane, from philosophical standpoint, wouldn't it be true that if some fundamentals were ever established, they are not supposed to change and don't need "substantial updates"? Otherwise they wouldn't be so fundamental... – Ale..chenski Feb 04 '18 at 00:04
  • @AliChen Tell that to Einstein. And I did mean substantive. – Sean Houlihane Feb 04 '18 at 00:07
  • @SeanHoulihane, If you know basics of Physics, you should know that the fundamental Newtonian Mechanics didn't change, only extension of it into outrageously extreme conditions (ultra-small/large scales and ultra-high velocities) was corrected. – Ale..chenski Feb 04 '18 at 03:26
  • 1
    And you are also offending OP by saying "your diagram", while it was a creation of theembeddedguy.com. And it wasn't me with -1. – Ale..chenski Feb 04 '18 at 03:28
1

The chart isn't about inputs and outputs at all, so the question as phrased is meaningless.

Any given system can be described at different levels of detail, and that is what the chart is about. Each layer describes the same system, but using different terms of reference.

For example, you could describe a web server at the highest level of abstraction as a computer that accepts HTTP requests and provides the requested data, where "HTTP request" is defined in a particular standards document as a TCP/IP connection carrying data in a particular format (the next level of detail).

The same system could be described in terms of the electromagnetic fields that it receives and transmits, along with how the electrical charges move within the patterns of metal and semiconductor within it. This would be the "physics" level of abstraction. It provides a lot of detail, but it's really too much detail to be useful in terms of understanding the high-level behavior.

In computer systems, the highest levels of abstraction are defined in software. In a sense, each layer of abstraction "runs on" the virtual machine defined by the next-lower level. The ISA is the level at which the transition from software to hardware is made: the ISA defines the hardware-software interface. At this level, the "virtual machine" is very general-purpose, because in most cases, we don't want to be defining different hardware machines for different applications.

In some cases, the ISA itself is an abstraction that runs on a lower-level hardware machine. There are microcoded machines that can load different versions of microcode to impelment different ISAs. The microcode processor is made of physical registers and gates.

I'm trying to read between the lines of your question and answer a question that you didn't really ask — is any of this helping?

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393
0

I think the diagram is self-explanatory. Within the context and partitioning as presented in the original theembeddedguy.com article and the "input-output" paradigm, input for the layer pictured as "ISA" is the binary code generated at "Machine-Level Code". The ISA layer fetches the binary stream and parses it in accord with inner architecture of a processor. In the particular x86 architecture, it translates complex instructions (CISC) into simpler RISC-type formats in accord with inner processor micro-architecture. This is the "output".

The entire multi-level model is just an abstraction, and is not particularly useful in real world. The boundaries can be blurry, several more abstraction layers can be introduced, in implementations some layers can be combined, etc. The entire theembeddedguy.com article is an eclectic mix of terms, that likely explains the confusion.

Ale..chenski
  • 38,845
  • 3
  • 38
  • 103
  • Wow! In less than 60 seconds I have offended someone's feeling... Care to explain what you think is wrong in my answer? – Ale..chenski Feb 03 '18 at 23:23
  • The ISA has nothing to do with instruction decoding or internal microcode. The ISA defines instructions, registers, memory models, ... – TEMLIB Feb 03 '18 at 23:33
  • a) you insult the OP. b) the ISA is not part of a stack, it does not process (rather it informs the designer). – Sean Houlihane Feb 03 '18 at 23:40
  • 1
    @TEMLIB, within the context and partitioning as presented by OP from the original article, the ISA actually performs these functions, mainly of binary decoding. We can debate about meanings and definitions, but in the context of layman explanation from theembeddedguy.com, it does what I explained. – Ale..chenski Feb 03 '18 at 23:41
  • @SeanHoulihane, how did I insult the OP exactly? Explain please. – Ale..chenski Feb 03 '18 at 23:44
  • If the diagram were self-explanatory, there would be no need for the question. I don't think this question is a 'no research', but your answer comes very close to saying that. – Sean Houlihane Feb 03 '18 at 23:50
  • 1
    @SeanHoulihane, yes, the original article contains a fair explanation of what the "ISA" layer means in their diagram. Did you read the article that triggered the question? – Ale..chenski Feb 03 '18 at 23:56
  • The article doesn't 'own' the terminology, and clearly hasn't helped the OP to understand the different levels of complexity. It's also wrong in places (where it describes micro-architecture), at least from a CPU context. – Sean Houlihane Feb 04 '18 at 00:02