Programmability

How to make a chip programmable?

Prabhas Chongstitvatana

Chulalongkorn University

Outline (ppt)

What is programmability?

The ability to "reconfigure" digital blocks to perform different functions (easily).

What is a "program"?

A kind of "specification" (declarative) and a kind of "step-by-step" (imperative) recipe to do something.

What "represent" a program?

Diagram (flow-chart, state diagram), pattern (bits), and mostly language (script).

It has to be "concise" and most importantly "human readable" because engineers must be able to read and write it.  (It may not be easy to read though).

Examples of programs

bit patterns

higher level (event by signal names)

We will explore "language" from bottom-up (hardware to software)

Programmable computers

data path
control logic  (from my textbook "Computer Architecture: A systhesis" 2002, in revision)

simple processor

how the "funtional units" are used repeatedly to satisfy "a work".

how to "specify" this behaviour?

and it becomes a language. (assembly language)

The heart is the control logic (or control unit)

        hardwired
        softwired

How to softwired?  

Maurice Wilkes invented it around 1970.
Microprogramming

Processor  Sx-chip    Sx-microprogram     How to microprogram Sx chip    mspec.txt
  Making a new instruction for Sx-chip (microprogram)
  Machine level programming for Sx-chip  

Microprogram Vs. Assembly

Now we look at "high level"

assembly to high level language

Compiler technology

language design
language "implementation"

Implementation means how to execute the language on a particular "platform" (or processors).

"platform" is more like a virtual machine.

Example of high to asm

        a = b + c    

if a, b, c are local variables, they can be mapped to registers, then,

        add a b c

if a is global then some additional step is needed,

        add r1 b c
        st r1 a_global  (a slot in the memory)

Control flow

convert "flow" into "jump" (because assembly program is "linearly" code).

        if cond then true-act else false-act

        <cond>
        jump-if-false @else
        <true-act>
        jump @exit
else:
        <false-act>
exit:

Abstraction

function call, passing parameters, recursive function.

A compiler organisation

input:  source program (text file)
output: assembly program (text or object code)

lexical analyser   (change source to tokens)
parser                 (change tokens to parse-tree)
code generator     (change parse-tree to output)
optimiser             (improve output, faster, or smaller)

lexical analyser       (recogniser, automaton or FSM)
parser                    (grammar and parser generator)
code generator     (mostly a kind of "interpreter")
optimiser              (hand made)

Evaluator (virtual machine)
Code generator

Can a chip be programmed differently?


YES

data-flow
meta-interpreter  (cricket, lego-brick, scratch)
macro-recorder    (excell) (grid-based)
etc.

Demo

how to program at low level  (stupid simple assembly)
(calculator programming)
assembly language  (gentle intro)
mix high-low

microprogramming examples
how to generate a scanner from dictionary
how to generate a parser from grammar

Additional materials

Rz language

Chapter 6 Sx-processor   explain in details how Sx chip work at microprogramming level

Tools

Sx0 simulator (plus its assembler)   sx0-3.zip


End
last update  5 March 2013