Skip to content

Commit

Permalink
interrupts: correct ranges for IntSourcePortSimple (chipsalliance#2150)
Browse files Browse the repository at this point in the history
Previously `IntSourcePortSimple(num = 1, ports = 1, sources = 2)` would trip over the requirement about overlapping ranges on line 43. This makes the ranges unique for all simple sources within a simple port.

I think this is a more correct fix for the issue reported in chipsalliance#1738.
  • Loading branch information
hcook authored Oct 16, 2019
1 parent 9be1621 commit bf0e854
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/scala/interrupts/Parameters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ object IntSourcePortSimple
{
def apply(num: Int = 1, ports: Int = 1, sources: Int = 1, resources: Seq[Resource] = Nil) =
if (num == 0) Nil else
Seq.fill(ports)(IntSourcePortParameters(Seq.fill(sources)(IntSourceParameters(range = IntRange(0, num), resources = resources))))
Seq.fill(ports)(IntSourcePortParameters(
Seq.tabulate(sources)(idx => IntSourceParameters(range = IntRange(idx*num, idx*num+num), resources = resources))))
}

case class IntSinkPortParameters(sinks: Seq[IntSinkParameters])
Expand Down

0 comments on commit bf0e854

Please sign in to comment.