-
-
Notifications
You must be signed in to change notification settings - Fork 45
Digital: Adds Logic
and defines 9 logic levels, StdULogicVector
, and StdLogicVector
#144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c320139
to
2c6ee42
Compare
Codecov Report
@@ Coverage Diff @@
## main #144 +/- ##
==========================================
+ Coverage 67.35% 69.57% +2.21%
==========================================
Files 33 35 +2
Lines 1498 1558 +60
==========================================
+ Hits 1009 1084 +75
+ Misses 489 474 -15
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3872762
to
41e76d2
Compare
i::Int) | ||
getindex(s.logic, i) | ||
end | ||
function Base.getindex(s::LogicVector, i1::Int, i2::Int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we call it a vector if it can be multidimensional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remain consistent with std_logic_vector
and std_ulogic_vector
are the names used in IEEE Std_logic_1164.
Although its mostly used in vector form, it can be a matrix as well.
|
||
struct StdULogicVector{N} <: AbstractArray{Logic, N} | ||
logic::Array{Logic} | ||
level::Array{Int} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to store level
at all if it can be trivially computed from logic
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we use level for indexing, having level would be easier to access the logic tables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a logic table so that it takes Logic
indices, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This point is still not addressed. We need LogicTable{N} <: AbstractArray{Logic, N}
such that we can index into it using Logic
indices, so we don't even need to store level
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seemed like the simplest approach to index the values.
I see the point in a LogicTable
type. Will implement that.
end | ||
end | ||
|
||
const LogicVector = Union{StdULogicVector, StdLogicVector} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are they used for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
StdULogicVector, StdLogicVector are part the Std_logic_1164.
LogicVector is only for convenience while writing dispatches.
- `Uninitialized`, `ForcingUnknow`, `ForcingZero`, `ForcingOne`, `HighImpedence`, `WeakUnknown`, `WeakZero`, `WeakOne`, `DontCare` are added - `std_ulogic` is a dictionary
Co-authored-by: Fredrik Bagge Carlson <[email protected]>
- adds setindex! and related tests - logic and levels are now `Array` - predefined logic vectors are now consts
- refactor logic gate tables with LogicTable
First in series of PRs to implement the entire IEEE.Std_logic_1164 in Julia
This PR will be followed up to add things like: