!FQBlZBRjRMgQBRocZx:matrix.org

FIRRTL

9 Members
Discussion about the FIRRTL hardware IR and compiler2 Servers

Load older messages


SenderMessageTime
4 May 2021
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) The first thing I would attempt for this use-case is a HashMap 16:29:32
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) Like just use the node as key and the meta-data you want to store as value 16:29:53
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) * Going back to my earlier question on Jan 8, I had an idea that may or may not work. This is sort of a Scala question as well. Basically, I just found out about the ability to mix in traits to other classes (https://alvinalexander.com/scala/how-to-dynamically-add-scala-trait-to-object-instance/) and I could probably cook up something with that that addresses my needs.
However, I wonder if I'll run into trouble if I just start essentially subclassing all of the FIRRTL IR classes. Currently that seems to be fine, but are there plans to mark any of the classes final? Or some kind of behavior that requires IR nodes to invariantly be the official IR nodes? In that case this breaks down
16:29:53
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) * Going back to my earlier question on Jan 8, I had an idea that may or may not work. This is sort of a Scala question as well. Basically, I just found out about the ability to mix in traits to other classes (https://alvinalexander.com/scala/how-to-dynamically-add-scala-trait-to-object-instance/) and I could probably cook up something with that that addresses my needs.
However, I wonder if I'll run into trouble if I just start essentially subclassing all of the FIRRTL IR classes. Currently that seems to be fine, but are there plans to mark any of the classes final? Or some kind of behavior that requires IR nodes to invariantly be the official IR nodes? In that case this breaks down
16:30:10
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) Would be interesting to see if that gives you good enough performance. 16:30:10
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) * Going back to my earlier question on Jan 8, I had an idea that may or may not work. This is sort of a Scala question as well. Basically, I just found out about the ability to mix in traits to other classes (https://alvinalexander.com/scala/how-to-dynamically-add-scala-trait-to-object-instance/) and I could probably cook up something with that that addresses my needs.
However, I wonder if I'll run into trouble if I just start essentially subclassing all of the FIRRTL IR classes. Currently that seems to be fine, but are there plans to mark any of the classes final? Or some kind of behavior that requires IR nodes to invariantly be the official IR nodes? In that case this breaks down
20:09:55
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) Yeah I think I'll end up doing that. I just wish it was a little more schnazzy, you know? 😉 20:09:55
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) * Going back to my earlier question on Jan 8, I had an idea that may or may not work. This is sort of a Scala question as well. Basically, I just found out about the ability to mix in traits to other classes (https://alvinalexander.com/scala/how-to-dynamically-add-scala-trait-to-object-instance/) and I could probably cook up something with that that addresses my needs.
However, I wonder if I'll run into trouble if I just start essentially subclassing all of the FIRRTL IR classes. Currently that seems to be fine, but are there plans to mark any of the classes final? Or some kind of behavior that requires IR nodes to invariantly be the official IR nodes? In that case this breaks down
20:10:03
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) Thanks for the help btw, always appreciated 20:10:04
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) Simple is good :) 20:24:45
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) * Going back to my earlier question on Jan 8, I had an idea that may or may not work. This is sort of a Scala question as well. Basically, I just found out about the ability to mix in traits to other classes (https://alvinalexander.com/scala/how-to-dynamically-add-scala-trait-to-object-instance/) and I could probably cook up something with that that addresses my needs.
However, I wonder if I'll run into trouble if I just start essentially subclassing all of the FIRRTL IR classes. Currently that seems to be fine, but are there plans to mark any of the classes final? Or some kind of behavior that requires IR nodes to invariantly be the official IR nodes? In that case this breaks down
20:24:45
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) * Going back to my earlier question on Jan 8, I had an idea that may or may not work. This is sort of a Scala question as well. Basically, I just found out about the ability to mix in traits to other classes (https://alvinalexander.com/scala/how-to-dynamically-add-scala-trait-to-object-instance/) and I could probably cook up something with that that addresses my needs.
However, I wonder if I'll run into trouble if I just start essentially subclassing all of the FIRRTL IR classes. Currently that seems to be fine, but are there plans to mark any of the classes final? Or some kind of behavior that requires IR nodes to invariantly be the official IR nodes? In that case this breaks down
20:26:54
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) btw. you might want to look into using WrappedExpression as key to your hashmap. This makes sure to ignore the types when comparing for equality, so that things still work after type inference etc. 20:26:54
7 May 2021
@gitter-badger:gitter.immatrixbot (matrixbot) changed their display name from gitter-badger (The Gitter Badger) to matrixbot (matrixbot).05:30:28
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) Does anyone know which issue is tracking the problem of removed annotations in Dedup? 18:28:53
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) Seems like we have another case, were a PresetAnnotation gets removed once them same module is instantiated twice. 18:29:16
@jackkoenig-57e1805540f3a6eec0665030:gitter.imjackkoenig (Jack Koenig) Perhaps chipsalliance/firrtl#2168 could be repurposed to the more generic problem? 19:06:22
@seldridge:matrix.orgSchuyler Eldridge
In reply to @ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.im
Seems like we have another case, were a PresetAnnotation gets removed once them same module is instantiated twice.
Does it actually get removed or is promoted to an instance target annotation and then the emitter can't handle it?
20:01:09
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) I only know the symptom which is that we do not get the preset. 20:04:46
@ekiwi-5eb8a5fdd73408ce4fe34c5b:gitter.imekiwi (Kevin Laeufer) Not exactly sure what part exactly fails. 20:04:53
14 May 2021
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) Hi it's me again with another Info question 😅
On Windows, when setting the parser infoMode to AppendInfo(filename) with a Windows filename, a NumberFormatException is raised, since StringLit.unescape tries to interpret things after a backslash as an escape sequence (e.g. C:\users\... -> unicode escape \u + sers -> invalid)
I assume this is a bug, but just want to make sure I'm understanding that correctly
04:34:34
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) The trouble starts here: https://github.com/chipsalliance/firrtl/blob/6aa86b13abe25271278498836217c89c00d7b151/src/main/scala/firrtl/Visitor.scala#L73 04:35:31
@seldridge:matrix.orgSchuyler Eldridge
In reply to @nijssen-5ed9f518d73408ce4fe60080:gitter.im
The trouble starts here: https://github.com/chipsalliance/firrtl/blob/6aa86b13abe25271278498836217c89c00d7b151/src/main/scala/firrtl/Visitor.scala#L73
Ugh... Yeah, this looks like a bug. Feel free to open an issue. A trivial solution may be to just escape paths on the way in. (It sounds like they're not being escaped already?)
04:46:33
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) I think I can write a patch. Would it be acceptable to also apply the patch to older branches? 04:59:35
@seldridge:matrix.orgSchuyler Eldridge
In reply to @nijssen-5ed9f518d73408ce4fe60080:gitter.im
I think I can write a patch. Would it be acceptable to also apply the patch to older branches?
Yeah, it would be fine to backport the patch probably all the way to FIRRTL's 1.2.x branch. I expect this has been there for awhile. (If you haven't seen this, the backports get generated automatically after a merge if a dev marks the patch as milestone 1.2.x, 1.3.x, or 1.4.x) I expect this won't backport cleanly, but that can be fixed up later.
05:03:03
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) Hmm it seems that it's actually fixed in master, so I'll have to figure out how to backport that (I'm stuck on 1.3 for the time being) 05:46:15
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) Actually the work is even simpler: I think this PR could be backported pretty cleanly chipsalliance/firrtl#1690 06:27:12
@nijssen-5ed9f518d73408ce4fe60080:gitter.imnijssen (Thomas Nijssen) I'm trying to backport it and running into problems, it's mainly due to the phasing out of StringLit I think 07:22:30
@jackkoenig-57e1805540f3a6eec0665030:gitter.imjackkoenig (Jack Koenig) Changing the type of something in the IR is pretty intrusive (FileInfo's contents changing from StringLit to String) which is why we did it on a major boundary 19:38:54
@jackkoenig-57e1805540f3a6eec0665030:gitter.imjackkoenig (Jack Koenig) It's possible that the bug could be fixed with a more focused fix though, rather than trying to backport that larger change 19:39:21

There are no newer messages yet.


Back to Room List