@@ -1177,7 +1177,7 @@ object DFVal extends DFValLP:
11771177 export DFPhysical .Val .Ops .given
11781178 export TDFDouble .Val .Ops .given
11791179 export DFEnum .Val .Ops .given
1180- export DFOpaque .Val .Ops .evOpAsDFOpaqueIterable
1180+ export DFOpaque .Val .Ops .{ evOpAsDFOpaqueIterable , evOpClkAsClkComp , evOpRstAsRstComp }
11811181 export TDFString .Val .Ops .given
11821182 export ConnectOps .given
11831183
@@ -1252,8 +1252,9 @@ object DFVal extends DFValLP:
12521252 // connection in either direction where both implicit directions are available
12531253 inline if (lhsIsDFVal && rhsIsDFVal)
12541254 inline lhs match
1255- case lhs : DFValAny => inline rhs match
1256- case rhs : DFValAny => ConnectOps .specialConnect(lhs, rhs)
1255+ case lhs : DFVal [lt, lm] => inline rhs match
1256+ case rhs : DFVal [rt, rm] =>
1257+ ConnectOps .specialConnect[lt, lm, rt, rm](lhs, rhs)
12571258 // if the RHS is a modifier, this is a port/variable constructor,
12581259 // so we invoke the the implicit given operation only in one way
12591260 else if (rhsIsModifier) exactOp2[" <>" , DFC , Any ](lhs, rhs)
@@ -1541,24 +1542,34 @@ object ConnectOps:
15411542 ]
15421543 protected type ConnectableModifier [M <: ModifierAny ] =
15431544 M <:< Modifier [Any , Modifier .Connectable , Any , Any ]
1544- protected trait TC_Connect [Consumer <: DFValAny , Producer <: DFValAny ]:
1545- def connect (consumer : Consumer , producer : Producer )(using DFC ): Unit
1545+ protected trait TC_Connect [
1546+ CT <: DFTypeAny ,
1547+ CM <: ModifierAny ,
1548+ PT <: DFTypeAny ,
1549+ PM <: ModifierAny
1550+ ]:
1551+ def connect (consumer : DFVal [CT , CM ], producer : DFVal [PT , PM ])(using DFC ): Unit
15461552 protected object TC_Connect :
15471553 given [
15481554 CT <: DFTypeAny ,
15491555 CM <: ModifierAny ,
1550- Consumer <: DFVal [ CT , CM ] ,
1551- Producer <: DFValAny
1556+ PT <: DFTypeAny ,
1557+ PM <: ModifierAny
15521558 ](using
15531559 ConnectableModifier [CM ]
1554- )(using tc : DFVal .TC [CT , Producer ] ): TC_Connect [Consumer , Producer ] with
1555- def connect (consumer : Consumer , producer : Producer )(using DFC ): Unit =
1560+ )(using tc : DFVal .TC [CT , DFVal [ PT , PM ]] ): TC_Connect [CT , CM , PT , PM ] with
1561+ def connect (consumer : DFVal [ CT , CM ], producer : DFVal [ PT , PM ] )(using DFC ): Unit =
15561562 consumer.connect(tc(consumer.dfType, producer))
15571563
1558- private def specialConnectRuntime [L <: DFValAny , R <: DFValAny ](
1559- lhs : L ,
1560- rhs : R ,
1561- dualSummon : DualSummonTrapError [TC_Connect [L , R ], TC_Connect [R , L ]]
1564+ private def specialConnectRuntime [
1565+ CT <: DFTypeAny ,
1566+ CM <: ModifierAny ,
1567+ PT <: DFTypeAny ,
1568+ PM <: ModifierAny
1569+ ](
1570+ lhs : DFVal [CT , CM ],
1571+ rhs : DFVal [PT , PM ],
1572+ dualSummon : DualSummonTrapError [TC_Connect [CT , CM , PT , PM ], TC_Connect [PT , PM , CT , CM ]]
15621573 )(using dfc : DFC ): Unit = trydf {
15631574 (dualSummon.valueL, dualSummon.valueR) match
15641575 case (Some (tcL), Some (tcR)) =>
@@ -1573,12 +1584,19 @@ object ConnectOps:
15731584 end match
15741585 }(using dfc, CTName (" <>" ))
15751586
1576- private [core] transparent inline def specialConnect [L <: DFValAny , R <: DFValAny ](
1577- inline lhs : L ,
1578- inline rhs : R
1587+ private [core] transparent inline def specialConnect [
1588+ LT <: DFTypeAny ,
1589+ LM <: ModifierAny ,
1590+ RT <: DFTypeAny ,
1591+ RM <: ModifierAny
1592+ ](
1593+ inline lhs : DFVal [LT , LM ],
1594+ inline rhs : DFVal [RT , RM ]
15791595 )(using dfc : DFC ): Unit =
1580- val dualSummon =
1581- compiletime.summonInline[DualSummonTrapError [TC_Connect [L , R ], TC_Connect [R , L ]]]
1596+ val dualSummon = compiletime.summonInline[DualSummonTrapError [
1597+ TC_Connect [LT , LM , RT , RM ],
1598+ TC_Connect [RT , RM , LT , LM ]
1599+ ]]
15821600 specialConnectRuntime(lhs, rhs, dualSummon)
15831601 end specialConnect
15841602
0 commit comments