-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tester unification #551
Comments
As a heavy user & developer of peekpoke testers 1~3 years ago, I strongly disagree with this suggestion unless the following issues are resolved:
|
So there are two separate goals for this issue:
So having a peek-poke programming model isn't mutually exclusive with not having dependency hell, and we should make sure to discuss the pros and cons of each issue separately. |
You're right that there are two separate goals, but I think @donggyukim is right in that fixing the packaging strategy should be super high priority because the current system doesn't really work. Unifying the repos won't fix the problem because this problem affects anyone who wishes to create a repo with their own Chisel utils or custom Firrtl passes (eg. https://github.com/ucb-bar/barstools). To the best of my knowledge, sbt does not have an easy way of doing development with local versions (as we have discussed in #499). I recently found a couple of StackOverflow posts that might be helpful: |
I'd be kind of upset if you entirely remove the peek-poke setup. It's super easy to get started with and mimics how some people would write (non-synthesizable) test benches. And I agree that the packaging strategy right now is a huge nightmare. Every time I want to update something, I hate to go through 5 different dependencies and all publish-local and hope that I'm on compatible versions. I spent a good hour last night just updating firrtl and everything else and hoping that no dependency broke. (and then I ran into the problem of barstools still not actually compiling...). |
+1 on the sbt packaging issues It seems like there are 2 options for getting everything that we what (easy concurrent test drivers and easy sequencing of events in time). One option is to stick with the scala based software test model and implement some sort of event driven scheduling system. This option provides the full power of scala in writing the driver logic, but writing a event scheduler seems like a lot of work and a step back to verilog ... The other options is to synthesize peek (check?), poke, step into Chisel state machines. This option provides good backwards compatibility with the existing hardware based tests, so people don't have to rewrite the tests yet again, which is a pretty big pro. However, there is less power in how to sequence the peek, poke, steps and there might be issues with running very large test vectors with this system since everything has to be synthesized into hardware. I think I prefer the synthesized peek, poke, steps approach. Very large software driven tests probably don't need to concurrent drivers since they are whole system tests, so they can probably be written against the verilator produced C++. Also, don't we already have the SteppedHWIOTester? Is nobody using that anymore? |
@shunshou when you want to write non-synthesizable testbenches, is it because you want to be able to control things in timesteps, or because you need to do some compute in Scala? The first could be solved in a synthesizable test specification model by having a framework to generate a state machine from check / poke / step commands, while the second is pretty much incompatible with a synthesizable framework. One issue with synthesizable testbenches would be the delay model to use, since a common programming model is waiting until some condition (like signal valid) is true. A solution might be just It also seems like everyone here hates the packaging setup. What does everyone want to see there? A mega-repo of chisel3, FIRRTL, FIRRterpreter, and chisel-testers? Or some other split of those repositories? It seems the SteppedHWIOTester is still there, but not much work has happened on it. Which I think is a good reason we should unifying testers... |
Mega repo with git submodules seems like a logical solution. What was the reason for moving away from that model before? I know rocket had some issues with it. What where they? |
@dt27182 The project repo with git submodules is still the goal, the problem comes from dependencies between these submodules and sbt's lack of support for specifying that you want to use a local build instead of the library dependency. I'm trying to figure out how to work around this (see the StackOverflow links above), but I'm pretty sure it's impossible to do 100% with sbt, so we can look into using some sort of setup script or possibly environment variables to workaround. |
@ducky64 for both reasons. Synthesizable tb makes sense, but only after I do sufficient debug with peek/poke. It's like I personally prefer to peek and stare at stuff before I convert everything into expects. |
@jackkoenig And what is the reason we want to publish the subparts as sbt libraries? |
@shunshou do you think the peek-for-debug could be replaced with a cycle-dependent printf? |
@ducky64 a single mega repo is a one time solution that doesn't fix the fundamental problem. Anyone who wants to create a chisel library that uses an sbt library dependency in the common case but can also be used in development mode will run into the same problem. @dt27182 That is correct, and I think you've hit the nail on the head. Should we be publishing the subparts all separately? We currently have a 1-to-1 mapping of git repos to sbt libraries. Perhaps it would be better to publish everything together again. The repos can stay separate and instead the chisel-release repo publishes them as a single library. |
Publishing together still doesn't solve the problem of separate chisel libraries though. I have an idea that might work: Libraries like barstools have two sbt projects in them: |
@ducky64 does the printf thing work w/ Verilator? |
@shunshou Yes it does! And checkout the chisel3 wiki page about printing (if you don't know about Chisel's custom string interpolator for printf). |
Basically, you can do stuff like val (cycle, _) = Counter(true.B, 10)
val myReg = Reg(UInt(32.W))
printf(p"At cycle $cycle: myReg = $myReg\n") |
@jackkoenig so my issue there is -- at least for PeekPokeTester, I can't peek/poke internal signals with Verilator. Idk how using an inline printf resolves this issue. Please explain? |
Ah yeah it doesn't fix that |
But you're saying that if I printf IO, I can do it even with Verilator? Printf stuff makes sense with firrtlInterpreter, since you have access to internal nodes, but at least with PeekPoke, I can bring the internal signals out and hook it up to Verilator. If I don't have the PeekPoke connection to Verilator, idk how that helps me any. |
We should make packaging a separate issue (from tester unification). |
Ok, the summary so far seems to be (and please correct me if I'm wrong):
And from the initial post we have:
So the solutions seems to be:
Does this sound like a good solution that addresses everyone's use case? |
It now seems that there are people who want to advocate for the Scala-driven testers (I think mostly for hardware models written in Scala?), which vastly complicates things now... We're going to have a meeting next week about this. If you have thoughts and example use cases, please make them known on this thread. If you have a serious stake in this are are interested in attending, let us know... |
Interested in attending |
Ok, results from today's meeting: Internal testing modelThe fundamental testing model is circuit-based, with the DUT and test driver(s) being modules that are hooked up in a circuit simulator. The whole thing may or may not be synthesizable. Rationale:
Tester User APIsWe don't expect to be able to unify the tester API while supporting all possible use cases. Additionally, the above testing model allows a lot of flexibility in the implementation of each test driver module (such as calls to Scala code in black box test drivers). Instead, we will focus (for now) on developing a testing API that will be the "default" for Chisel. These are the requirements we came up with:
Concurrency ModelConcurrency was discussed and is overall a hard problem. The model we were thinking of was a parallel ("threading") model, but with checks to prevent people from shooting themselves in the foot. The simplest is a dynamic check, which ensures within a cycle, peek results are not changed by poke results from another "thread" (and will assert out otherwise). More advanced checks based on static (combinational dependence) analysis may be possible. MiscMisc notes that may be helpful:
As always, thoughts and feedback are welcome! |
I'd like to add build directory management must be overhauled. There are two competing use case
|
Superseded by #725. |
Currently, we have three tester interfaces:
Of course, all these testers have their problems and advantages (some fundamental, some engineering):
The goal here is to unify all the different testers into a single tester included in Chisel3.
Reasoning:
Some hybrid approaches have been suggested:
@jackkoenig @jackbackrack @sdtwigg @dt27182 @chick @azidar @aswaterman
The text was updated successfully, but these errors were encountered: