Conversation
…logy-ports-semantics
…ology-ports-semantics
…ology-ports-semantics
…ology-ports-semantics
…ology-ports-semantics
compiler/tools/fpp-check/test/connection_direct/invalid_port_instance.ref.txt
Outdated
Show resolved
Hide resolved
compiler/tools/fpp-check/test/connection_direct/undef_instance.ref.txt
Outdated
Show resolved
Hide resolved
compiler/tools/fpp-check/test/port_matching/p2_not_port_instance.ref.txt
Outdated
Show resolved
Hide resolved
| loc: Location // The location whether the connection is requested | ||
| ): Result.Result[Unit] = Right(()) | ||
|
|
||
| override def equals(obj: Any): Boolean = |
There was a problem hiding this comment.
Why do we need to override equals here? What happens if we use the default equals?
There was a problem hiding this comment.
This is required because we need a slightly more permissive == compared to default. This is so that we can compute port interfaces as sets of port instances. The default rule will also check the node.id which is not relevant for port instance but just for error reporting.
There was a problem hiding this comment.
That makes sense, thanks!
There was a problem hiding this comment.
I think what we are doing here is defining an equivalence relation that says that two port instance values are the same if they represent the same port instance in the context of a single interface. However, I'm a bit uncomfortable with the way the code is written -- it imposes a global equality relation to encode a relation that only makes sense locally. That could cause confusion in another context where we need or expect the true value equality relationship, and it's been overridden. Let's discuss offline.
This PR implements topology port semantics according to the spec from #748
Interesting Changes
interfaceInstanceUseportMap+specialPortMapwere moved out into a separatePortInterfaceconstruct so that it could be reused inside topologyPortInstance.Topologyfor wrapping ports with a new name to impement topology ports.Closes #745