Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tapasco
tapasco
Commits
f93ae122
Commit
f93ae122
authored
Dec 13, 2017
by
Jens Korinth
Browse files
Simplify overlap logic in BitRange
parent
57c18b2b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/scala/axi4lite/package.scala
View file @
f93ae122
...
...
@@ -4,8 +4,7 @@ package object axi4lite {
/** Tuple-type for bit ranges. */
sealed
case
class
BitRange
(
to
:
Int
,
from
:
Int
)
{
require
(
to
>=
from
&&
from
>=
0
,
"BitRange: invalid range (%d, %d)"
.
format
(
to
,
from
))
def
overlapsWith
(
other
:
BitRange
)
:
Boolean
=
(
from
<=
other
.
from
&&
to
>=
other
.
from
)
||
(
from
>
other
.
from
&&
from
<=
other
.
to
)
def
overlapsWith
(
other
:
BitRange
)
:
Boolean
=
!(
to
<
other
.
from
||
from
>
other
.
to
)
}
/** Names for bit ranges. **/
type
BitfieldMap
=
Map
[
String
,
BitRange
]
...
...
Jens Korinth
@jk
mentioned in commit
17f0d672
·
Mar 05, 2018
mentioned in commit
17f0d672
mentioned in commit 17f0d67240ebf5d7e1d0be9162d272b04256c47d
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment