simuhw.memory package
Subpackages
Module contents
- class simuhw.memory.Memory(width: int, width_a: int, model: MemorizingModel)
Bases:
DeviceThe super class for all memory devices.
- __init__(width: int, width_a: int, model: MemorizingModel) None
Creates a memory device.
- Parameters:
width – The word width in bits.
width_a – The address word width in bits.
model – The memorizing model.
- add_probe(probe: MemoryProbe, address: bytes) None
Adds a memory probe.
- Parameters:
probe – The memory probe to be added.
address – The probe address.
- Raises:
ValueError – If a memory probe with a different word width is specified in
probe.
- property port_o: OutputPort
The output port.
- remove_all_probes() None
Removes all memory probes.
- remove_probe(probe: MemoryProbe) None
Removes a memory probe.
- Parameters:
probe – The memory probe to be removed.
- Raises:
ValueError – If a memory probe not yet added is specified in
probe.
- reset() None
Resets the states.
- property width: int
The word width in bits.
- property width_a: int
The address word width in bits.
- class simuhw.memory.LevelTriggeredMemory(width: int, width_a: int, *, model: ~simuhw.memory.model._base.MemorizingModel = <simuhw.memory.model._real.RealMemorizingModel object>, neg_leveled: bool = False)
Bases:
MemoryA level-triggered memory device.
- __init__(width: int, width_a: int, *, model: ~simuhw.memory.model._base.MemorizingModel = <simuhw.memory.model._real.RealMemorizingModel object>, neg_leveled: bool = False) None
Creates a level-triggered memory device.
- Parameters:
width – The word width in bits.
width_a – The address word width in bits.
model – The memorizing model.
neg_leveled –
Trueif negative-leveled,Falseotherwise.
- property negative_leveled: bool
Trueif negative-leveled,Falseotherwise.
- reset() None
Resets the states.
- work(time: float | None) tuple[list[InputPort], float | None]
Makes the device work.
- Parameters:
time – The current time in seconds.
Nonewhen starting to make the device work.- Returns:
A tuple of the list of the input ports that are to be watched receive a signal, and the next resuming time in seconds. The next resuming time can be
Noneif resumable anytime.
- class simuhw.memory.EdgeTriggeredMemory(width: int, width_a: int, *, model: ~simuhw.memory.model._base.MemorizingModel = <simuhw.memory.model._real.RealMemorizingModel object>, neg_edged: bool = False, neg_enable: bool = False)
Bases:
MemoryAn edge-triggered memory device.
- __init__(width: int, width_a: int, *, model: ~simuhw.memory.model._base.MemorizingModel = <simuhw.memory.model._real.RealMemorizingModel object>, neg_edged: bool = False, neg_enable: bool = False) None
Creates an edge-triggered memory device.
- Parameters:
width – The word width in bits.
width_a – The address word width in bits.
model – The memorizing model.
neg_edged –
Trueif negative-edged,Falseotherwise.neg_enable –
Trueif enabled by 0,Falseotherwise.
- property negative_edged: bool
Trueif negative-edged,Falseotherwise.
- property negative_enabling: bool
Trueif enabled by 0,Falseotherwise.
- reset() None
Resets the states.
- work(time: float | None) tuple[list[InputPort], float | None]
Makes the device work.
- Parameters:
time – The current time in seconds.
Nonewhen starting to make the device work.- Returns:
A tuple of the list of the input ports that are to be watched receive a signal, and the next resuming time in seconds. The next resuming time can be
Noneif resumable anytime.