Skip to content

Conversation

@Bastian-Krause
Copy link
Member

@Bastian-Krause Bastian-Krause commented Feb 28, 2018

Adds the driver itself, an example strategy and documentation.

The example strategy can be used like this:

targets
  my-target:
    resources:
      RemotePlace:
        name: 'my-target'
    drivers:
      - QuartusHPSDriver: {}
      - SerialDriver:
          txdelay: 0.01
      - NetworkPowerDriver:
          delay: 5.0
      - BareboxDriver:
          prompt: 'barebox@[^:]+:[^ ]+ '
          autoboot: "abort autoboot"
          interrupt: "\x03"
      - ShellDriver:
          prompt: 'root@[^:]+:[^ ]+'
          login_prompt: ' login: '
          username: 'root'
      - QuartusHPSStrategy:
          image_xload: /path/to/barebox-xload.img
          image: /path/to/barebox.img

imports:
- examples/strategy/quartusstrategy.py

Signed-off-by: Bastian Stender bst@pengutronix.de

@Bastian-Krause
Copy link
Member Author

Should I include the configuration snippet from the commit message in the docs or is it self-explanatory enough? If yes, where should I include it?

@codecov-io
Copy link

codecov-io commented Feb 28, 2018

Codecov Report

Merging #206 into master will decrease coverage by <.1%.
The diff coverage is 44.2%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #206     +/-   ##
========================================
- Coverage    52.7%   52.6%   -0.1%     
========================================
  Files          91      92      +1     
  Lines        5161    5213     +52     
========================================
+ Hits         2722    2745     +23     
- Misses       2439    2468     +29
Impacted Files Coverage Δ
labgrid/driver/__init__.py 100% <100%> (ø) ⬆️
labgrid/driver/quartushpsdriver.py 43.1% <43.1%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da27e4f...b044f96. Read the comment docs.

@Emantor Emantor self-requested a review February 28, 2018 16:04
Copy link
Member

@Emantor Emantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except your are not implementing a protocol.

I am not sure we want to include the strategy or start a seperate repository with examples. This way we could have the basic examples in here and more elaborate Strategies in another repo, splitting out that complexity from the actual library.


@target_factory.reg_driver
@attr.s(cmp=False)
class QuartusHPSDriver(Driver):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to implement a Protocol. BootstrapProtocol would be the obvious choice, however your driver implements an additional feature: choosing the address of where to load the file. I am not sure that we want to extend the existing protocol or define a new one for this.

@Bastian-Krause
Copy link
Member Author

Pushed changes:

  • add FlashProtocol
  • let QuartusHPSDriver implement FlashProtocol
  • adjust docs accordingly

I have no strong opinion if more elaborate strategies should be in another repository. @jluebbe ?

@jluebbe
Copy link
Member

jluebbe commented Mar 2, 2018

We discussed this internally and decided that having the FlashProtocol with this simple implementation doesn't help us much currently. Also, it would cause more churn when we add a more general FlashProtocol later. So we prefer to use the QuartusHPSDriver directly for now.

Adds the driver itself, an example strategy and documentation.

The example strategy can be used like this:

targets
  my-target:
    resources:
      RemotePlace:
        name: 'my-target'
    drivers:
      - QuartusHPSDriver: {}
      - SerialDriver:
          txdelay: 0.01
      - NetworkPowerDriver:
          delay: 5.0
      - BareboxDriver:
          prompt: 'barebox@[^:]+:[^ ]+ '
      - ShellDriver:
          prompt: 'root@[^:]+:[^ ]+'
          login_prompt: ' login: '
          username: 'root'
      - QuartusHPSStrategy:
          image_xload: /path/to/barebox-xload.img
          image: /path/to/barebox.img

imports:
- examples/strategy/quartusstrategy.py

Signed-off-by: Bastian Stender <bst@pengutronix.de>
@Bastian-Krause
Copy link
Member Author

Pushed changes:

  • remove FlashProtocol

Should the QuartusHPSStrategy be part of Labgrid or do you want it in a separate repo?

Copy link
Member

@jluebbe jluebbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the strategy in examples/ makes it easier to find, so I'll merge this as is.

@jluebbe jluebbe merged commit 1c94f86 into labgrid-project:master Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants