|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.krep.evalbench.program.KlpAssembler
public class KlpAssembler
Read and assembler a assembler file for the KLP.
Constructor Summary | |
---|---|
KlpAssembler()
generate empty assembler description. |
Method Summary | |
---|---|
int |
adr2row(int i)
compute at which line in the assembler code a absolute pc is displayed. |
void |
assemble(String n,
InputStream p)
Assemble a given program string and generated object code in readable hex coded format and instruction array. |
void |
assemble(String tName,
KLP tModel)
|
void |
assemble(String n,
String program)
Assemble a given program string and return object code information in readable hex coded format. |
String |
canExecute(IConfig c)
Check whether the Assembler can be executed on the current processor This should check, whether the correct processor (KEP/KReP) is used, and whether it has enough resources, like number of signals, etc. |
LinkedList<Signal> |
getInputs()
After a program has been assembled, a list of input signals can be extracted. |
String[][] |
getInstructions()
After a program has been assembled, an array with the contained instructions can be extracted. |
String |
getName()
|
String[] |
getObj(IConfig c)
After a program has been assembled, an array with the contained object-code can be extracted. |
LinkedList<Signal> |
getOutputs()
After a program has been assembled, a list of output signals can be extracted. |
HashMap<String,Integer> |
getSignalIndex()
|
int |
getTickLen()
|
int |
size()
The number of instructions in the program. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KlpAssembler()
Method Detail |
---|
public void assemble(String tName, KLP tModel) throws ParseException
tName
- Name of the modeltModel
- model parsed by xtext parser
ParseException
- thrown for parse errors, e.g., undefined labels or registerspublic String canExecute(IConfig c)
canExecute
in interface IAssembler
c
- the configuration
public LinkedList<Signal> getInputs()
getInputs
in interface IAssembler
public String[][] getInstructions()
"loop0:"
, or an empty string if there is
no label for that instruction. The third string contains the readable
assembler instruction code.
getInstructions
in interface IAssembler
public LinkedList<Signal> getOutputs()
getOutputs
in interface IAssembler
public String[] getObj(IConfig c)
getObj
in interface IAssembler
c
- configuration of the current processor
public HashMap<String,Integer> getSignalIndex()
getSignalIndex
in interface IAssembler
public int adr2row(int i)
adr2row
in interface IAssembler
i
- absolute address in memory
public int size()
size
in interface IAssembler
public String getName()
getName
in interface IAssembler
public void assemble(String n, InputStream p) throws ParseException
assemble
in interface IAssembler
n
- Name of the programp
- assembler program
ParseException
- when the input string has an invalid formatpublic int getTickLen()
getTickLen
in interface IAssembler
public void assemble(String n, String program) throws ParseException
assemble
in interface IAssembler
n
- Name of the programprogram
- assembler program
ParseException
- when the input string has an invalid format
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |