Skip to main content

Module model

Module model 

Source
Expand description

The model attempts to document what the HashX constraints are, separate from the process of implementing those constraints.

Re-exportsΒ§

use crate::program::NUM_INSTRUCTIONS; πŸ”’
use crate::program::Opcode; πŸ”’
use crate::register; πŸ”’
use crate::register::RegisterId; πŸ”’

EnumsΒ§

Pass πŸ”’
One specific pass in the multi-pass instruction choice process
RegisterWriter πŸ”’
Information about the instruction that writes to a register, from the perspective of our particular constraints here

ConstantsΒ§

DISALLOW_REGISTER_FOR_ADDSHIFT πŸ”’
Special case for register R5
REQUIRED_INSTRUCTIONS πŸ”’
Programs require an exact number of instructions. (The instruction buffer must have filled without any of the other stopping conditions)
REQUIRED_MULTIPLIES πŸ”’
Programs require an exact total number of multiply instructions, they can’t be skipped for any reason.
REQUIRED_OVERALL_RESULT_AT_CYCLE πŸ”’
Programs require an exact overall data latency, represented as the simulated cycle at which the last register write completes.

FunctionsΒ§

disallow_opcode_pair πŸ”’
Should proposed be rejected as the immediate successor of previous?
disallow_src_is_dst πŸ”’
Does an instruction prohibit using the same register for src and dst?
is_multiply πŸ”’
Determine which ops count when testing REQUIRED_MULTIPLIES.
writer_pair_allowed πŸ”’
Should this_writer be allowed on a register which was previously written using last_writer?