asyncvlsi / act

ACT hardware description language and core tools.
http://avlsi.csl.yale.edu/act
GNU General Public License v2.0
95 stars 21 forks source link

ACT does not accept user-defined type from wiki #47

Closed fhuemer closed 2 days ago

fhuemer commented 3 days ago

To Reproduce Steps to reproduce the behavior:

  1. Use the ACT source included below.
  2. Run e.g. act:read in interact on the source file shown below
  3. The following error message is produced:
interact> act:read mytype.act
ERROR: File `mytype.act', line 5, col 9
    Assignments only permitted to `self' or `selfack' in HSE body

ACT source I have a single source file containing just the user type type definition from the wiki

deftype mystruct <: int<16> (int<4> f1, f2; int<8> f3)
{
  methods {
   set {
     f1:=self >> 12;
     f2:=(self >> 8) & 0xf;
     f3:=self & 0xff
   }
   get {
     self:=(f1 << 12) | (f2 << 8) | f3
   }
  }
}

Computer setup (please complete the following information):

rmanohar commented 3 days ago

Thanks for catching this! This is a bug in the documentation (I just updated it). An earlier version of the language supported this particular feature, but it has since been removed from the language. (We found that it was quite confusing.)

fhuemer commented 2 days ago

Thank you for clarifying this!