pub struct VhdlFile { /* private fields */ }
Implementations§
Source§impl VhdlFile
impl VhdlFile
Sourcepub fn new(file_name: &str) -> VhdlFile
pub fn new(file_name: &str) -> VhdlFile
Examples found in repository?
examples/vhdl/adder.rs (line 20)
10fn main() -> Result< (), std::io::Error > {
11 let mut adder = Entity::new( "adder" );
12 adder.add_generic( Generic::new_with_default( "SIZE", "positive", "32" ) );
13 adder.add_port( Port::new( "a", Direction::IN, "unsigned( SIZE - 1 downto 0 )" ) );
14 adder.add_port( Port::new( "b", Direction::IN, "unsigned( SIZE - 1 downto 0 )" ) );
15 adder.add_port( Port::new( "c", Direction::OUT, "unsigned( SIZE - 1 downto 0 )" ) );
16
17 let mut rtl = Architecture::new( "rtl", & adder );
18 rtl.add_signal_assignment( SignalAssignment::new_with_label( "add", "c", "a + b" ));
19
20 let mut vhdl_file = VhdlFile::new( "examples/vhdl/adder.vhd" );
21 vhdl_file.add_architecture( rtl );
22 vhdl_file.write()?;
23 Ok(())
24}
pub fn add_entity(&mut self, design_unit: Entity)
Sourcepub fn add_architecture(&mut self, design_unit: Architecture)
pub fn add_architecture(&mut self, design_unit: Architecture)
Examples found in repository?
examples/vhdl/adder.rs (line 21)
10fn main() -> Result< (), std::io::Error > {
11 let mut adder = Entity::new( "adder" );
12 adder.add_generic( Generic::new_with_default( "SIZE", "positive", "32" ) );
13 adder.add_port( Port::new( "a", Direction::IN, "unsigned( SIZE - 1 downto 0 )" ) );
14 adder.add_port( Port::new( "b", Direction::IN, "unsigned( SIZE - 1 downto 0 )" ) );
15 adder.add_port( Port::new( "c", Direction::OUT, "unsigned( SIZE - 1 downto 0 )" ) );
16
17 let mut rtl = Architecture::new( "rtl", & adder );
18 rtl.add_signal_assignment( SignalAssignment::new_with_label( "add", "c", "a + b" ));
19
20 let mut vhdl_file = VhdlFile::new( "examples/vhdl/adder.vhd" );
21 vhdl_file.add_architecture( rtl );
22 vhdl_file.write()?;
23 Ok(())
24}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VhdlFile
impl !RefUnwindSafe for VhdlFile
impl !Send for VhdlFile
impl !Sync for VhdlFile
impl Unpin for VhdlFile
impl !UnwindSafe for VhdlFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more