|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jfrace.SystemConfigurator
Configure a computer system based on a configuration file. The configuration file is like a Java Properties file with key-value pairs (where '=' is the delimiter between the key and the value). A key-value pair has to be in one line. Empty lines and lines starting with '#' will be ignored. Contrary to properties file there can be several key-value pairs for the same key.
Numerical values can be denoted either decimal, binary (with a leading '0b'), octal (with a leading '0'), or hexadecimal (with a leading 0x).
The following table explains all keys and the meaning of their
values. Note, that packagePrefix
and
defaultValue
have to be defined before the first
CPU, RAM
, or device
definition.
Key | Default Value | Multiple Definitions? | Meaning |
---|---|---|---|
packagePrefix | mandatory | no | Package prefix for all dynamically loaded classes.
The subpackages cpu, device , and
terminal are derived from the main
package.
|
defaultValue | mandatory | no | Default return value of the AddressSpace
when no address bank is defined for a given address
in a getValue() or getByte()
call.
|
yieldInterval | 1000 |
no | Number of clock cycles between two calls of
Thread.yield() . After such a call the
Thread.sleep() will be invoked if
a delay is necessary to adapt the effective
clock frequency to the frequency defined in the
property clockFrequency .
|
clockFrequency | the maximum | no | The frequency of the system clock (in MHz). After
yieldInterval numbers of clock cycles a
delay will be made to adapt the emulation speed to this
frequency. If clockFrequency is not defined.
no delay will be performed an the emualtion runs at the
maximum speed possible.
|
adaptationTime | 2000 |
no | The time (in milliseconds) between two recalibration
of the time origin. In addition the effective clock
frequency will be printed onto the console if the
command line option -p is set.
|
CPU | yes | Definition of a CPU. The value has to be
CPUConfigurator .
| |
RAM | yes | Definition of a memory bank (RAM or ROM).
The value has to be
RAM.createRAMAndAddToAS() .
| |
device | yes | Definition of a device. The value has to be
Configurator for
this device. The interpretation of the string
<configuration resources>
depends on the Configurator . In most
cases it will be the name of a configuration file.
|
Example of a configuration file:
packagePrefix = jfrace defaultValue = 0 CPU = MC6502 CPU = Intel8080 0x20000 setPortBiasAddress(0x30000) RAM = 8 0 0xc000 RAM = 8 0xc000 ROM.dat 3 RAM = 8 0x20000 65536 device = GI_AY_3_8910 0x300b6 device = CPMEmulator CPMConfig1.cfg
Constructor Summary | |
SystemConfigurator(java.net.URL theDocumentBase)
Create an instance for the given document base. |
Method Summary | |
void |
configure(java.lang.String configSource,
java.lang.String[] args)
Configure a computer system based on the given configuration source. |
long |
getAdaptationTime()
Return the property adaptationTime read from
the configuration data. |
AddressSpace |
getAddressSpace()
Return the address space. |
double |
getClockFrequency()
Return the clock frequency. |
long |
getYieldInterval()
Return the property yieldInterval read from
the configuration data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SystemConfigurator(java.net.URL theDocumentBase)
theDocumentBase
- Method Detail |
public AddressSpace getAddressSpace()
configure(java.lang.String, java.lang.String[])
.public double getClockFrequency()
configure(java.lang.String, java.lang.String[])
.public long getYieldInterval()
yieldInterval
read from
the configuration data. Default value is 1000.
Call this method after configure(java.lang.String, java.lang.String[])
.public long getAdaptationTime()
adaptationTime
read from
the configuration data. Default value is 2000.
Call this method after configure(java.lang.String, java.lang.String[])
.public void configure(java.lang.String configSource, java.lang.String[] args) throws ConfigurationException
configSource
- Absolute or relative URL of the
configuration file.args
- Arguments needed by Configurators
of Devices
declared in the configuration file.ConfigurationException
- in the case of an error
(including syntax errors in the configuration file).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |