-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The TopLevelInput and TopLevelOutput busses should be map-able to pins on the target board.
This could be implemented with an attribute, like this:
[TopLevelOutput]
public interface MyBus : IBus
{
[Pin("G32")]
public bool StatusLED { get; set; }
}The generated VHDL will then be augmented with a constraint file that maps the relevant pins.
This can be further simplified with a board configuration class, i.e.:
public static class ZedBoard_v1
{
public static string LED0 = "G32";
}The user code can then map it like this:
using static Zeboard_v1;
[TopLevelOutput]
public interface MyBus : IBus
{
[Pin(LED0)]
public bool StatusLED { get; set; }
}The using static statement allows easy board switching, provided the boards have the same named components. It would also be trivial to write a bait-n-switch class that simply maps items based on compile directives, i.e.:
public static class Board
{
#if BOARDTARGET_ZEDBOARD
public static string LED0 = "G32";
#elif BOARDTARGET_PYNQ
public static string LED0 = "F16";
#else
#error Unsupported board
#endif
}The board can then be used with:
[TopLevelOutput]
public interface MyBus : IBus
{
[Pin(Board.LED0)]
public bool StatusLED { get; set; }
}Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels