Skip to content
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

PcieHost.bsv fails to build for multiple targets #185

Closed
RadhikaG opened this issue Nov 6, 2021 · 11 comments
Closed

PcieHost.bsv fails to build for multiple targets #185

RadhikaG opened this issue Nov 6, 2021 · 11 comments

Comments

@RadhikaG
Copy link

RadhikaG commented Nov 6, 2021

Tool versions

Description

With make build.vcu118:

Error: "<path>/connectal/bsv/PcieHost.bsv", line 87, column 8: (T0031)
  The provisos for this expression could not be resolved because there are no
  instances of the form:
    Add#(0, 16, 32)
  The proviso was implied by expressions at the following positions:
    "<path>/connectal/bsv/PcieHost.bsv", line 88, column 26
Error: "<path>/connectal/bsv/PcieHost.bsv", line 127, column 4: (T0031)
  The provisos for this expression could not be resolved because there are no
  instances of the form:
    Connectable::Connectable#(ClientServer::Server#(PCIE::TLPData#(16), PCIE::TLPData#(16)), ClientServer::Client#(PCIE::TLPData#(32), PCIE::TLPData#(32)))
obj/Makefile:384: recipe for target 'obj/PcieHost.bo' failed

With make build.vc707g2:

Error: "<path>/connectal/bsv/PcieHost.bsv", line 87, column 8: (T0031)
  The provisos for this expression could not be resolved because there are no
  instances of the form:
    Add#(0, 16, 32)
  The proviso was implied by expressions at the following positions:
    "<path>/connectal/bsv/PcieHost.bsv", line 88, column 26
Error: "<path>/connectal/bsv/PcieHost.bsv", line 168, column 12: (T0020)
  Type error at:
    tlp

  Expected type:
    ClientServer::Client#(PCIE::TLPData#(ConnectalConfig::TlpDataBytes),
                      PCIE::TLPData#(ConnectalConfig::TlpDataBytes))

  Inferred type:
    ClientServer::Client#(PCIE::TLPData#(16), PCIE::TLPData#(16))

obj/Makefile:380: recipe for target 'obj/PcieHost.bo' failed
@jameyhicks-cmt
Copy link

Please attach git log -n 1 from bsc and bsc-contrib. I have not tested with open source bsc recently so I would like to know how to reproduce this.

@jameyhicks-cmt
Copy link

I'm building from current head of main:

commit 91ad4276a74525410a9efe132785b812af5c9fc3 (HEAD -> main, origin/main)
Author: Julie Schwartz <quark@bluespec.com>
Date:   Sun Nov 7 17:24:54 2021 +1300

    Display the GHC version when building

@jameyhicks-cmt
Copy link

Also, which version of vivado are you using?

@jameyhicks-cmt
Copy link

I have reproduced this problem. Something is wrong with bsvdepend. It seems to have the right search path but it's not finding PCIE.bo in the library.

@jameyhicks-cmt
Copy link

I see the problem. Connectal depends on bsc-contrib being installed into the same place as bsc. I was able to reproduce this because I forgot to do that step.

Connectal also still depends on the BLUESPECDIR environment variable pointing to the "lib" directories which contains "Libraries".

@jameyhicks-cmt
Copy link

To install bsc-contrib:

    make PREFIX=$PWD/../bsc/inst install
    

@RadhikaG
Copy link
Author

RadhikaG commented Nov 9, 2021

Hi Jamey, thanks for your reply!


So we've been trying to get open-source bluespec to play well with Connectal for an accelerator design we have (which previously used closed-source bluespec), for the vcu118 hardware target.

We grabbed the open source versions of bsc and bsc-contrib and installed them in the appropriate places, and got the open source stuff working in simulation (using the build.verilator target).

However we started hitting snags for build.vcu118. This is the first error we hit:

BSV_BO [<path>/connectal/generated/xilinx/PCIEWRAPPER3u.bsv]
make[1]: *** No rule to make target 'obj/XilinxVirtex7PCIE.bo', needed by 'obj/Pcie3EndpointX7.bo'.  Stop.
connectal/Makefile.connectal:57: recipe for target 'build.vcu118' failed
make: *** [build.vcu118] Error 2

I couldn't find XilinxVirtex7PCIE.bo in any of B-Lang-Org's official repos. I did however find it in an ancient unofficial copy of the bluespec source floating around on GitHub, and copied that into Connectal.

Compilation moved a bit further along but finally died at:

Error: "<path>/connectal/bsv/PcieHost.bsv", line 87, column 8: (T0031)
  The provisos for this expression could not be resolved because there are no
  instances of the form:
    Add#(0, 16, 32)
  The proviso was implied by expressions at the following positions:
    "<path>/connectal/bsv/PcieHost.bsv", line 88, column 26
Error: "<path>/connectal/bsv/PcieHost.bsv", line 127, column 4: (T0031)
  The provisos for this expression could not be resolved because there are no
  instances of the form:
    Connectable::Connectable#(ClientServer::Server#(PCIE::TLPData#(16), PCIE::TLPData#(16)), ClientServer::Client#(PCIE::TLPData#(32), PCIE::TLPData#(32)))
obj/Makefile:384: recipe for target 'obj/PcieHost.bo' failed

I decided to get the examples compiled to narrow down where exactly do things break. Most of the examples compiled (for the vcu118, vc707g2, and the vcu108 targets), except memread256 and memwrite256, which died with the same error as above.

It turns out having DataBusWidth=256 is the problem; our Connectal code uses DataBusWidth=256 as well.


The fix:

We've temporarily downgraded our Connectal interface to DataBusWidth=128 and everything compiles and runs okay for us.

However our Connectal interface did work with DataBusWidth=256 with closed source bluespec, which leads me to suspect that either the open source version is missing some library, or Connectal itself isn't playing well with a bus size 256 bits wide.


It would be great if you could help us figure this out!

@jameyhicks
Copy link
Member

jameyhicks commented Nov 9, 2021 via email

@jameyhicks
Copy link
Member

jameyhicks commented Nov 9, 2021 via email

@RadhikaG
Copy link
Author

RadhikaG commented Nov 9, 2021

I'm using Vivado v.2020.1.

@RadhikaG
Copy link
Author

Also, I'll close this issue and open up another one for DataBusWidth=256 support. Would also like to figure out how to get the Xilinx libraries into open source bluespec (because those are pretty fundamental to getting the PCIe stuff working it seems!), but that I'll raise with the B-Lang-Org folks I guess.

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

No branches or pull requests

3 participants