freechipsproject / firrtl-interpreter

A scala based simulator for circuits described by a LoFirrtl file
Other
47 stars 23 forks source link

firrtl-interpreter internal structure #148

Open kai413629305 opened 5 years ago

kai413629305 commented 5 years ago

What is the internal structure of firrtl-interpreter and what is the model? How to change the signal inside the model(poke or peek)? Can someone explain it? See the source code or do not understand.

chick commented 5 years ago

Is there a particular application of this question it would help me to narrow the answer. In general the interpreter does just that parses an firrtl abstract syntax tree. It executes by interpreting the tree on each pass keeping track of the values associated with each wire. Typically peeks and pokes operate only on top level io's due to constraints in the chisel-testers framework. It is however possible to create a FirrtlTerp instance directly with firrtl input and have peek access to any element of the circuit. The FirrtlRepl allows an interactive command line way of doing this also.

Firrtl is the older and less developed Scala based circuit simulator. Treadle is the newer and faster one. It has similar features, and a few more capabilities

kai413629305 commented 5 years ago

Is there a particular application of this question it would help me to narrow the answer. In general the interpreter does just that parses an firrtl abstract syntax tree. It executes by interpreting the tree on each pass keeping track of the values associated with each wire. Typically peeks and pokes operate only on top level io's due to constraints in the chisel-testers framework. It is however possible to create a FirrtlTerp instance directly with firrtl input and have peek access to any element of the circuit. The FirrtlRepl allows an interactive command line way of doing this also.

Firrtl is the older and less developed Scala based circuit simulator. Treadle is the newer and faster one. It has similar features, and a few more capabilities

Thank you for your answer. I just understood firrtl-interpreter a while ago.