Skip to content

Commit

Permalink
Various refactors, remove block_vec
Browse files Browse the repository at this point in the history
  • Loading branch information
VonTum committed Jul 9, 2024
1 parent de5fa23 commit 53384ff
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 499 deletions.
18 changes: 9 additions & 9 deletions bitSerialMatrixMultiply.sus
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@



module use_BitSerialMatrixMultiply {
gen int[10][10] MATRIX
module BitSerialMatrixMultiply {
gen int[10][15] MATRIX

for int X in 0..10 {
for int X in 0..15 {
for int Y in 0..10 {
// Try 1/4 random-ish number generation
if ((X + Y) * 7 + ((X+1)*10) / (Y+1)) % 4 == 0 {
Expand All @@ -15,12 +15,14 @@ module use_BitSerialMatrixMultiply {
}
}

BitSerialMatrixMultiply::<WIDTH = 10, HEIGHT = 10, MATRIX = MATRIX;> bsm
interface BitSerialMatrixMultiply : bool start, int[10] values -> int[15] result

result = BitSerialMatrixMultiplyTemplate::<WIDTH = 10, HEIGHT = 15, MATRIX = MATRIX;>(start, values)
}



module BitSerialMatrixMultiply {
module BitSerialMatrixMultiplyTemplate {
input gen int WIDTH
input gen int HEIGHT

Expand All @@ -31,7 +33,7 @@ module BitSerialMatrixMultiply {

BitSerialMatrixMultiplyState::<WIDTH, HEIGHT, MATRIX;> bsm_state

interface BitSerialMatrixMultiply : bool start, int[WIDTH] values -> int[WIDTH] result
interface BitSerialMatrixMultiplyTemplate : bool start, int[WIDTH] values -> int[HEIGHT] result

state bool[WIDTH][INT_BITWIDTH] split_into_bits

Expand All @@ -49,9 +51,7 @@ module BitSerialMatrixMultiply {
bsm_state.feed(false, split_into_bits[0])
}

if iter.last {
result = LatencyOffset::<INT_BITWIDTH;int[WIDTH]>(bsm_state.result_vector)
}
result = LatencyOffset::<INT_BITWIDTH;int[HEIGHT]>(bsm_state.finish(iter.last))

if start {
iter.start(true)
Expand Down
4 changes: 2 additions & 2 deletions src/abstract_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ pub struct TypeUnifier<'linker, 'errs> {

impl<'linker, 'errs> TypeUnifier<'linker, 'errs> {
pub fn new(linker_types : Resolver<'linker, 'errs, TypeUUIDMarker, NamedType>, template_inputs : &TemplateInputs, errors : &'errs ErrorCollector<'linker>, domain_names : &FlatAlloc<String, DomainIDMarker>) -> Self {
let domains = domain_names.iter().map(|(_id, name)| DomainTypeSubstitution::KnownDomain { name: name.clone() }).collect();
let final_domains = domain_names.iter().map(|(_id, _interface)| BestName::NamedDomain).collect();
let domains = domain_names.map(|(_id, name)| DomainTypeSubstitution::KnownDomain { name: name.clone() });
let final_domains = domain_names.map(|(_id, _interface)| BestName::NamedDomain);
Self {
linker_types,
template_type_names : map_to_type_names(template_inputs),
Expand Down
Loading

0 comments on commit 53384ff

Please sign in to comment.