Skip to main content

Crate min_infmachine_lltk

Crate min_infmachine_lltk 

Source
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§

MinInfInstr
Machine single instruction (table entry).

Enums§

FromTableError
Conversion from table error.
MinInfFunc
Machine function type.
MinInfFuncConvertError
Conversion error for MinInfFunc.
MinInfInstrConvertError
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. bit is value.
minf_mrw
Gets machine function: memory read and write value. bit is value.
minf_tbrw
Gets machine function: temp buffer read and write value. bit is 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§

MinInfPos
Type of position of function (it include state and function return).