/// <summary> /// Constructs a new instance. /// </summary> /// <param name="mappedVariable">variable to be hardware-mapped</param> /// <param name="directFeed"><c>true</c>, if write-trough semantics hold, i.e. input is combinatorially routed to output during write access</param> public LocalStorageUnit(Variable mappedVariable, bool directFeed) { MappedVariable = mappedVariable; _directFeed = directFeed; DataWidth = (int)TypeLowering.Instance.GetWireType(mappedVariable.Type).Constraints[0].Size; StdLogicVector initial; if (mappedVariable.InitialValue == null) { initial = StdLogicVector._0s(TypeLowering.Instance.GetWireWidth(mappedVariable.Type)); } else { initial = Marshal.SerializeForHW(mappedVariable.InitialValue); } _stg = new SLVSignal(DataWidth) { InitialValue = initial }; _taSite = new LocalStorageUnitTransactionSite(this); }
/// <summary> /// Constructs a new instance. /// </summary> /// <param name="mappedVariable">variable to be hardware-mapped</param> /// <param name="directFeed"><c>true</c>, if write-trough semantics hold, i.e. input is combinatorially routed to output during write access</param> public LocalStorageUnit(Variable mappedVariable, bool directFeed) { MappedVariable = mappedVariable; _directFeed = directFeed; DataWidth = (int)TypeLowering.Instance.GetWireType(mappedVariable.Type).Constraints[0].Size; StdLogicVector initial; if (mappedVariable.InitialValue == null) initial = StdLogicVector._0s(TypeLowering.Instance.GetWireWidth(mappedVariable.Type)); else initial = Marshal.SerializeForHW(mappedVariable.InitialValue); _stg = new SLVSignal(DataWidth) { InitialValue = initial }; _taSite = new LocalStorageUnitTransactionSite(this); }