-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract FFI functions to another file
- Loading branch information
Showing
9 changed files
with
63 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//! Modules implemented as FFI. | ||
|
||
#![allow(unused_variables)] | ||
|
||
use super::execute::systolic_array::mesh::*; | ||
use super::execute::systolic_array::mesh_with_delays::*; | ||
use super::execute::systolic_array::pe::*; | ||
use super::*; | ||
|
||
/// Chisel MeshWithDelays Wrapper. | ||
#[magic(ffi::MeshWithDelaysWrapper())] | ||
pub fn mesh_with_delays_ffi<const LATENCY: usize>( | ||
a: Vr<A>, | ||
b: Vr<B>, | ||
d: Vr<D>, | ||
req: I<VrH<MeshReq, TagsInProgress>, { Dep::Helpful }>, | ||
) -> Valid<MeshResp> | ||
where | ||
[(); 1 + LATENCY]:, | ||
{ | ||
ffi!("MeshWithDelaysWrapper.v") | ||
} | ||
|
||
/// Chisel Mesh Wrapper. | ||
/// | ||
/// This module allows students to proceed with future assignments even if they have not completed assignment 5. | ||
#[magic(ffi::MeshWrapper())] | ||
pub fn mesh_ffi(in_left: MeshRowData, in_top: MeshColData) -> (MeshRowData, MeshColData) { | ||
ffi!("MeshWrapper.v") | ||
} | ||
|
||
/// Chisel Transposer Wrapper. | ||
/// | ||
/// This module allows students to proceed with future assignments even if they have not completed assignment 5. | ||
#[magic(ffi::TransposerWrapper())] | ||
pub fn transposer_ffi(in_row: Valid<Array<U<INPUT_BITS>, 16>>) -> Valid<Array<U<INPUT_BITS>, 16>> { | ||
ffi!("TransposerWrapper.v") | ||
} | ||
|
||
/// Chisel PE Wrapper. | ||
/// | ||
/// This module allows students to proceed with future assignments even if they have not completed assignment 4. | ||
#[magic(ffi::PE256Wrapper())] | ||
pub fn pe_ffi( | ||
in_left: Valid<PeRowData>, | ||
(in_top_data, in_top_control): (Valid<PeColData>, Valid<PeColControl>), | ||
) -> (Valid<PeRowData>, (Valid<PeColData>, Valid<PeColControl>)) { | ||
ffi!("PE256Wrapper.v") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters