How to implement Systolic Array in DSLX #1663
Replies: 14 comments 7 replies
|
XLS[cc] is a compiler that targets hardware. Specifically, it targets hardware in the sense that the final output is verilog that you can (eventually) send to a fab to get built into a physical chip. Though its syntax is c++ it actually only supports a small subset of what a full C++ compiler does. To answer your questions:
|
|
It's very helpful. Thanks for your answer!
|
|
You say you "install" with the command
|
|
Thanks for sharing this. Two problems I met: |
|
I think this is a question for XLS[cc]'s maintainer at this point, rather than the rest of the contributors, since XLS[cc] is more of its own thing. @spurserh, want to weigh in? |
There is an arbitrary precision float implementation in dslx if you want to use that language instead. Take a look at our docs to learn more: https://google.github.io/xls/floating_point/. There isn't really any supported way to mix the xlscc with dslx stuff. With enough effort you could probably get something hacked together though (maybe inline apfloat compiled routines into asm blocks).
|
|
|
Hello team, But could you give me more hint about the status of your tools (especially syntax):
Q3: As is stated here, I also agree that the I appreciate all your help. And this will be very valuable for my project and I will be willing to contribute to you if my systolic array does work. Thanks very much. |
|
@Mars-Cat2023 I started to update the matmul example in b59c99a to properly use array of channels and lower to IR, hopefull that's useful. In order to do repeative channel operation and |
Yes, I think https://github.com/google/xls/blob/main/xls/examples/matmul_4x4/matmul_4x4.x is in a good shape, there is still a few workaround for pending issues (like #1750) but it does demonstrate idiomatic usage of
I believe it does support them all, I did remove the Hope that helps. |
|
(3) May I ask how can we write an array like A[6] = [4,2,1,3,3,5]; in DSLX? Otherwise, how can we write test_proc with arbitrary inputs easily? |
|
Responding to your questions (1) and (4), RE: order of array indexing - this has been discussed before, e.g., #616 (comment) Roughly, the issue here is a mismatch between Rust (which inspired the syntax of DSLX) and the syntax of other languages, including both SystemVerilog and most C-style languages. Currently, when you index into an array like F32[3][5], you're indexing from the outside in. So: an F32[3][5] array is a 5-element array of F32[3]'s, which are in turn 3-element arrays of F32s. Your confusion is one more data point suggesting that we need to fix this mismatch in some way! |
|
Thanks for the above answer. May I ask a follow-up question (@proppy), how you compile that DXLS code into IR? I looked at the reference https://google.github.io/xls/tools_quick_start/, and Issue #983. However, when I compile with the following command Actually, I have very similar struct as your sample code matmul_4x4.x provided in your example code folder. (But my version is 3x3). Here is snippet of this top function: Could you share how you solve this? How to get the Verilog from this dslx? Thanks. |
|
Thanks for your answer. After checking your long libraries and , I realize that we don't have "Division" in current apfloat. But I want to know is that is there any suggestions about how to implement FP division manually? Or any bypass I can do for this kind of operation? |





Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi!
How do we write things about "vector<int>" in our XLS[cc]? I would like to read and write values from and to xls channels (i.e., __xls_channel). Do we support that? Or other alternatives?
Or at least arrays like "int A[10];" "int A[10][10];". And what other array features do we support (How to access? etc.) What's the syntax I should use? It seems like we cannot do that with normal C++ code. Could you give me some small examples for this?
Could you tell me which standard C++ library do we support in XLS[cc]? (Maybe not the same library name, but XLS[cc] version) If so, how can I import that into my .cc code?
All reactions