Expand description
Low level toolkit to generate MinInfMachines. It provides builders with label handling, helpers that simplify writing strucutal code (for example routine calling, big data writing) and integrated builder that simplify usage of noticed helpers.
Path to generate MinInfMachine is using some builder, put all code and generate code
using to_code method. Further optional steps are optimization that provided by table_opt
module. Simple example:
use min_infmachine::*;
use min_infmachine_lltk::builder::*;
use min_infmachine_lltk::handler_builder::*;
use min_infmachine_lltk::table_opt::*;
use min_infmachine_lltk::*;
fn main() {
let mut builder = mi_std_sv_hbuilder_new(None, None, 1);
builder.i(MINF_TBRF);
builder.i(MINF_STOP);
let (code, labels) = builder.to_code();
let table = to_table(code);
let mut machine = MinInfMachine::<usize>::new_with_table(table).unwrap();
let machine = machine.to_toml().unwrap();
println!("{}", machine);
}Package min_infmachine_blabla_cpu is simple any bit CPU written by using this toolkit.
It is good example to learn that toolkit.
Modules§
- builder
- The builder module. Main builder module. It provides builders to build machine.
- handler
- The handlers module. It provides helpers to generate structutal code. Module provides few handlers (helpers) to write structured code. It provides following helpers:
- handler_
builder - Integrates builder and handlers together. Module that provides HandlerBuilder - object that integrates handlers with builder to simplify building MinInfMachines.
- table_
opt - Provides transition table optimization. Module provides final transition table (code) optimization routines.
Structs§
- MinInf
Instr - Machine single instruction (table entry).
Enums§
- From
Table Error - Conversion from table error.
- MinInf
Func - Machine function type.
- MinInf
Func Convert Error - Conversion error for MinInfFunc.
- MinInf
Instr Convert Error - MinInfInstr conversion error.
Constants§
- MACH_
MAB - Machine function: move memory address position backward.
- MACH_
MAR - Machine function: memory address read.
- MACH_
MARF - Machine function: memory address read and move memory address position forward.
- MACH_
MARW0 - Machine function: memory address read and write 0.
- MACH_
MARW1 - Machine function: memory address read and write 1.
- MACH_
MEM_ ADDRESS_ BACKWARD - Machine function: move memory address position backward.
- MACH_
MEM_ ADDRESS_ READ - Machine function: memory address read.
- MACH_
MEM_ ADDRESS_ READ_ FORWARD - Machine function: memory address read and move memory address position forward.
- MACH_
MEM_ ADDRESS_ READ_ WRITE_ 0 - Machine function: memory address read and write 0.
- MACH_
MEM_ ADDRESS_ READ_ WRITE_ 1 - Machine function: memory address read and write 1.
- MACH_
MEM_ READ - Machine function: memory read.
- MACH_
MEM_ READ_ WRITE_ 0 - Machine function: memory read and write 0.
- MACH_
MEM_ READ_ WRITE_ 1 - Machine function: memory read and write 1.
- MACH_MR
- Machine function: memory read.
- MACH_
MRW0 - Machine function: memory read and write 0.
- MACH_
MRW1 - Machine function: memory read and write 1.
- MACH_S
- Machine function: Stop.
- MACH_S2
- Machine function: Stop 2.
- MACH_S3
- Machine function: Stop 3.
- MACH_
STOP - Machine function: Stop.
- MACH_
STOP_ 2 - Machine function: Stop 2.
- MACH_
STOP_ 3 - Machine function: Stop 3.
- MACH_
TBB - Machine function: move temp buffer position backward.
- MACH_
TBR - Machine function: temp buffer read.
- MACH_
TBRF - Machine function: temp buffer read and move temp buffer position forward.
- MACH_
TBRW0 - Machine function: temp buffer read and write 0.
- MACH_
TBRW1 - Machine function: temp buffer read and write 1.
- MACH_
TEMP_ BUFFER_ BACKWARD - Machine function: move temp buffer position backward.
- MACH_
TEMP_ BUFFER_ READ - Machine function: temp buffer read.
- MACH_
TEMP_ BUFFER_ READ_ FORWARD - Machine function: temp buffer read and move temp buffer position forward.
- MACH_
TEMP_ BUFFER_ READ_ WRITE_ 0 - Machine function: temp buffer read and write 0.
- MACH_
TEMP_ BUFFER_ READ_ WRITE_ 1 - Machine function: temp buffer read and write 1.
- MINF_
MAB - Machine function: move memory address position backward.
- MINF_
MAR - Machine function: memory address read.
- MINF_
MARF - Machine function: memory address read and move memory address position forward.
- MINF_
MARW0 - Machine function: memory address read and write 0.
- MINF_
MARW1 - Machine function: memory address read and write 1.
- MINF_MR
- Machine function: memory read.
- MINF_
MRW0 - Machine function: memory read and write 0.
- MINF_
MRW1 - Machine function: memory read and write 1.
- MINF_S
- Machine function: Stop.
- MINF_S2
- Machine function: Stop 2.
- MINF_S3
- Machine function: Stop 3.
- MINF_
STOP - Machine function: Stop.
- MINF_
STOP2 - Machine function: Stop 2.
- MINF_
STOP3 - Machine function: Stop 3.
- MINF_
TBB - Machine function: move temp buffer position backward.
- MINF_
TBR - Machine function: temp buffer read.
- MINF_
TBRF - Machine function: temp buffer read and move temp buffer position forward.
- MINF_
TBRW0 - Machine function: temp buffer read and write 0.
- MINF_
TBRW1 - Machine function: temp buffer read and write 1.
Functions§
- from_
table - Convert from table into code (list of instructions). Panics if failed.
- is_fr0
- Returns true if position is function return 0.
- is_fr1
- Returns true if position is function return 1.
- minf_db
- Gets machine function: move sequential data position backward.
- minf_dr
- Gets machine function: move sequential data read.
- minf_
drf - Gets machine function: sequential data read and move it position forward.
- minf_
drw - Gets machine function: move sequential data read and write bit value.
- minf_
drw0 - Gets machine function: move sequential data read and write 0.
- minf_
drw1 - Gets machine function: move sequential data read and write 1.
- minf_
marw - Gets machine function: memory address read and write value.
bitis value. - minf_
mrw - Gets machine function: memory read and write value.
bitis value. - minf_
tbrw - Gets machine function: temp buffer read and write value.
bitis value. - to_
table - Convert code (list of instructions) into MinInfMachine transition table. Panics if failed.
- try_
from_ table - Tries to convert from table into code (list of instructions).
- try_
to_ table - Tries to convert code (list of MinInfInstrs) into MinInfMachine transition table.
Type Aliases§
- MinInf
Pos - Type of position of function (it include state and function return).