Coder Social home page Coder Social logo

interact's People

Contributors

michael-jy-he avatar rmanohar avatar yang-yihang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

interact's Issues

v2act: rhs explisit and implisit array assign not recognised

(let me know if you rather want the clear cut act issues in the act repo)

current behavior

assignment of arrays without rage, implicitly assume the full range does not work:

module blk0(e0, out);
  input [4:0] e0;
  output [4:0] out;
  assign out = e0;
endmodule

with error message

Assertion failed, file sync.cc, line 170
Assertion: lhs == NULL
ERR: no way

it also does not like the range description (not as important):

module blk0(e0, out);
  input [4:0] e0;
  output [4:0] out;
  assign out = e0[4:0];
endmodule

with error

Parse error: Expecting token `]', got `:'
	File `./expropt0_mapped.v', line: 5, col: 25
Exception: number=1, message -none-
FATAL: Uncaught exception

proposed behavior

treat like:

module blk0(e0, out);
  input [4:0] e0;
  output [4:0] out;
  assign out = {e0[4],e0[3],e0[2],e0[1],e0[0]};
endmodule

or

module blk0(e0, out);
  input [4:0] e0;
  output [4:0] out;
  assign out[4]=e0[4];
  assign out[3]=e0[3];
  assign out[2]=e0[2];
  assign out[1]=e0[1];
  assign out[0]=e0[0];
endmodule

why

yosis generates this notation (the first example)

v2act: ignore "(* <comment> *)" style verilog comments

current behavior:

parsing stops for

verilog

(* module blk1 for expr *)
module blk1(a,b,out);
  output [1:0] out;
  input a,b;
  assign out[0] = b;
  assign out[1] = a;
endmodule

proposed fix:

treat like

// module blk1 for expr
module blk1(a,b,out);
  output [1:0] out;
  input a,b;
  assign out[0] = b;
  assign out[1] = a;
endmodule

reason:

yosys stores original signal names in this comment style after cell mapping in structual verilog output

v2act: namespace support for celllib

current state:

the v2act -l <celllib.act> <verilog.v> assumes the cell lib to live inside namespace sync or async.

if the cells are in a different namespace they are reported as missing modules.

celllib.act :

namespace sync {
  export defcell INVX1 (bool? A; bool! Y)
  {
    prs {
      A => Y-
    }
  }
}

verilog.v

module blk1(in,out);
  output [1:0] out;
  input [1:0] in;
  
  INVX1 cell1(.A (in[0]), .Y (out[0]));
  INVX1 cell2(.A (in[1]), .Y (out[1]));
endmodule

output:

defproc blk1 (bool? in[2], bool! out[2])
{
   /*--- types ---*/
   INVX1 cell1;
   INVX1 cell2;
  /*--- connections ---*/
   cell1(.A=in[0], .Y=out[0]);
   cell1(.A=in[1], .Y=out[1]);
}

proposed behavior:

v2act -l <celllib.act> [-n namespace::subnamespace] with default to sync/async namespace

namespace::subnamespace can be any namespace hierarchy

namespace <namespace> {
namespace <subnamespace> {
  export defcell INVX1 (bool? A; bool! Y)
  {
    prs {
      A => Y-
    }
  }
}
}

verlig.v same as above

output:

defproc blk1 (bool? in[2], bool! out[2])
{
   /*--- types ---*/
   namespace::subnamespace::INVX1 cell1;
   namespace::subnamespace::INVX1 cell2;
  /*--- connections ---*/
   cell1(.A=in[0], .Y=out[0]);
   cell1(.A=in[1], .Y=out[1]);
}

purely optional (current use case does not need it):

have the ability to define multiple namespaces in which cells sit in.

v2act: support verilog signal concat "assing c = {<a>,<b>}"

current state:

lexer stops

for verilog

module blk1(a,b,out);
  output [1:0] out;
  input a,b;
  
 assign out = {a,b};
endmodule

proposed fix:

treat like

module blk1(a,b,out);
  output [1:0] out;
  input a,b;
  
 assign out[0] = b;
 assign out[1] = a;
 
endmodule

reason

yosys uses this notation in its structural verilog output

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.