re-export bitvec and add types useful for simulation to the prelude
All checks were successful
/ deps (pull_request) Successful in 15s
/ test (pull_request) Successful in 4m12s
/ deps (push) Successful in 13s
/ test (push) Successful in 4m40s

This commit is contained in:
Jacob Lifshay 2025-04-03 15:59:03 -07:00
parent 62058dc141
commit 6929352be7
Signed by: programmerjake
SSH key fingerprint: SHA256:HnFTLGpSm4Q4Fj502oCFisjZSoakwEuTsJJMSke63RQ
5 changed files with 19 additions and 14 deletions

View file

@ -746,7 +746,7 @@ impl ToTokens for ParsedBundle {
}
fn sim_value_from_bits(
&self,
bits: &::fayalite::__bitvec::slice::BitSlice,
bits: &::fayalite::bitvec::slice::BitSlice,
) -> <Self as ::fayalite::ty::Type>::SimValue {
#![allow(unused_mut, unused_variables)]
let mut v = ::fayalite::bundle::BundleSimValueFromBits::new(*self, bits);
@ -757,7 +757,7 @@ impl ToTokens for ParsedBundle {
fn sim_value_clone_from_bits(
&self,
value: &mut <Self as ::fayalite::ty::Type>::SimValue,
bits: &::fayalite::__bitvec::slice::BitSlice,
bits: &::fayalite::bitvec::slice::BitSlice,
) {
#![allow(unused_mut, unused_variables)]
let mut v = ::fayalite::bundle::BundleSimValueFromBits::new(*self, bits);
@ -766,7 +766,7 @@ impl ToTokens for ParsedBundle {
fn sim_value_to_bits(
&self,
value: &<Self as ::fayalite::ty::Type>::SimValue,
bits: &mut ::fayalite::__bitvec::slice::BitSlice,
bits: &mut ::fayalite::bitvec::slice::BitSlice,
) {
#![allow(unused_mut, unused_variables)]
let mut v = ::fayalite::bundle::BundleSimValueToBits::new(*self, bits);
@ -895,7 +895,7 @@ impl ToTokens for ParsedBundle {
}
fn sim_value_from_bits(
&self,
bits: &::fayalite::__bitvec::slice::BitSlice,
bits: &::fayalite::bitvec::slice::BitSlice,
) -> <Self as ::fayalite::ty::Type>::SimValue {
#![allow(unused_mut, unused_variables)]
let mut v = ::fayalite::bundle::BundleSimValueFromBits::new(*self, bits);
@ -906,7 +906,7 @@ impl ToTokens for ParsedBundle {
fn sim_value_clone_from_bits(
&self,
value: &mut <Self as ::fayalite::ty::Type>::SimValue,
bits: &::fayalite::__bitvec::slice::BitSlice,
bits: &::fayalite::bitvec::slice::BitSlice,
) {
#![allow(unused_mut, unused_variables)]
let mut v = ::fayalite::bundle::BundleSimValueFromBits::new(*self, bits);
@ -915,7 +915,7 @@ impl ToTokens for ParsedBundle {
fn sim_value_to_bits(
&self,
value: &<Self as ::fayalite::ty::Type>::SimValue,
bits: &mut ::fayalite::__bitvec::slice::BitSlice,
bits: &mut ::fayalite::bitvec::slice::BitSlice,
) {
#![allow(unused_mut, unused_variables)]
let mut v = ::fayalite::bundle::BundleSimValueToBits::new(*self, bits);

View file

@ -880,7 +880,7 @@ impl ToTokens for ParsedEnum {
}
fn sim_value_from_bits(
&self,
bits: &::fayalite::__bitvec::slice::BitSlice,
bits: &::fayalite::bitvec::slice::BitSlice,
) -> <Self as ::fayalite::ty::Type>::SimValue {
let v = ::fayalite::enum_::EnumSimValueFromBits::new(*self, bits);
match v.discriminant() {
@ -890,7 +890,7 @@ impl ToTokens for ParsedEnum {
fn sim_value_clone_from_bits(
&self,
value: &mut <Self as ::fayalite::ty::Type>::SimValue,
bits: &::fayalite::__bitvec::slice::BitSlice,
bits: &::fayalite::bitvec::slice::BitSlice,
) {
let v = ::fayalite::enum_::EnumSimValueFromBits::new(*self, bits);
match v.discriminant() {
@ -900,7 +900,7 @@ impl ToTokens for ParsedEnum {
fn sim_value_to_bits(
&self,
value: &<Self as ::fayalite::ty::Type>::SimValue,
bits: &mut ::fayalite::__bitvec::slice::BitSlice,
bits: &mut ::fayalite::bitvec::slice::BitSlice,
) {
let v = ::fayalite::enum_::EnumSimValueToBits::new(*self, bits);
match value {

View file

@ -8,8 +8,6 @@
extern crate self as fayalite;
#[doc(hidden)]
pub use bitvec as __bitvec;
#[doc(hidden)]
pub use std as __std;
@ -78,6 +76,8 @@ pub use fayalite_proc_macros::hdl_module;
#[doc(inline)]
pub use fayalite_proc_macros::hdl;
pub use bitvec;
/// struct used as a placeholder when applying defaults
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
pub struct __;

View file

@ -20,7 +20,7 @@ pub use crate::{
hdl_cover_with_enable, MakeFormalExpr,
},
hdl, hdl_module,
int::{Bool, DynSize, KnownSize, SInt, SIntType, Size, UInt, UIntType},
int::{Bool, DynSize, KnownSize, SInt, SIntType, SIntValue, Size, UInt, UIntType, UIntValue},
memory::{Mem, MemBuilder, ReadUnderWrite},
module::{
annotate, connect, connect_any, incomplete_wire, instance, memory, memory_array,
@ -29,9 +29,15 @@ pub use crate::{
phantom_const::PhantomConst,
reg::Reg,
reset::{AsyncReset, Reset, SyncReset, ToAsyncReset, ToReset, ToSyncReset},
sim::{
time::{SimDuration, SimInstant},
value::{SimValue, ToSimValue, ToSimValueWithType},
ExternModuleSimulationState, Simulation,
},
source_location::SourceLocation,
ty::{AsMask, CanonicalType, Type},
util::{ConstUsize, GenericConstUsize},
wire::Wire,
__,
};
pub use bitvec::{slice::BitSlice, vec::BitVec};

View file

@ -2,12 +2,11 @@
// See Notices.txt for copyright information
use fayalite::{
int::UIntValue,
memory::{ReadStruct, ReadWriteStruct, WriteStruct},
module::{instance_with_loc, reg_builder_with_loc},
prelude::*,
reset::ResetType,
sim::{time::SimDuration, vcd::VcdWriterDecls, Simulation},
sim::vcd::VcdWriterDecls,
util::RcWriter,
};
use std::num::NonZeroUsize;