-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add pre-process step and a driver function to the test infrastructure #664
base: staging
Are you sure you want to change the base?
Conversation
74b703c
to
2b1f8f5
Compare
03b311a
to
37de9ce
Compare
Since this rewrites all the tests using VexRiscv to be programmed before HITL test start it needs to access all FPGAs via JTAG, but #649 blocks this, so the software clock control HITL test is blocked on that. |
e6eda91
to
c8b539d
Compare
76d7cbe
to
51e6ae4
Compare
f26a03a
to
d557c16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
My biggest concern is use of manual cleanup calls. We should make sure we clean up properly, even in case of errors --- hence the need for bracket style resource allocation. Other than that LGTM.
data DeviceInfo = DeviceInfo | ||
{ deviceId :: String | ||
, dna :: BitVector 96 | ||
, serial :: String | ||
, usbAdapterLocation :: String | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add some example strings to the field docs?
| CustomPreProcess | ||
(VivadoHandle -> FilePath -> HwTarget -> DeviceInfo -> IO (TestStepResult c)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this override or is this an additional step? Could you add that to the docs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does an override, an additional step would have a different signature and be more complex (how does the driver receive the user-data from multiple different pre-process functions?).
I'll add that to the docs!
let targetIndex = fromMaybe 9 $ L.findIndex (\d -> d.deviceId == targetId) demoRigInfo | ||
let gdbPort = 3333 + targetIndex | ||
|
||
(ocd, ocdClean) <- startOpenOcd deviceInfo.usbAdapterLocation gdbPort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I very much want to discourage manual resource cleaning. Bracket-style is the way to go. I.e., use withBlaBla
functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree generally. Here the "issue" is that the pre-process step might want to open some programs and then make them available in the driver function. If a bracket-style function is used to start programs then there's no way to pass them through to the driver function (for example opening GDB to program the core, then later interacting with it using GDB commands)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh... okay I don't have a great solution right now, but be should definitely make an issue out of it.
openHwT :: VivadoHandle -> HwTarget -> IO () | ||
openHwT v hwT = do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openHwT :: VivadoHandle -> HwTarget -> IO () | |
openHwT v hwT = do | |
openHwTarget :: VivadoHandle -> HwTarget -> IO () | |
openHwTarget v hwT = do |
c6286a7
to
55c8ca2
Compare
55c8ca2
to
5fc0399
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make an issue out of resource allocation. Other than the small comments, LGTM. Can we help debugging the failing CI?
Just rebased on the most recent staging (: |
e585db4
to
086ce0f
Compare
70344b7
to
b4bb20c
Compare
b4bb20c
to
92e5469
Compare
92e5469
to
f911902
Compare
This adds a pre-process and driver function to HITL tests as well as re-order some code.