1
0
mirror of https://github.com/corundum/corundum.git synced 2025-01-16 08:12:53 +08:00

Add FPGA ID code for userspace tools

This commit is contained in:
Alex Forencich 2020-10-02 16:53:41 -07:00
parent 2a137bccbd
commit a7241bc597
2 changed files with 257 additions and 0 deletions

138
utils/fpga_id.c Normal file
View File

@ -0,0 +1,138 @@
/*
Copyright 2020, The Regents of the University of California.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE REGENTS OF THE UNIVERSITY OF CALIFORNIA ''AS
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF CALIFORNIA OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of The Regents of the University of California.
*/
#include "fpga_id.h"
struct fpga_id {
int id;
char part[16];
};
const struct fpga_id fpga_id_list[] =
{
// Artix 7
{FPGA_ID_XC7A15T, "XC7A15T"},
{FPGA_ID_XC7A35T, "XC7A35T"},
{FPGA_ID_XC7A50T, "XC7A50T"},
{FPGA_ID_XC7A75T, "XC7A75T"},
{FPGA_ID_XC7A100T, "XC7A100T"},
{FPGA_ID_XC7A200T, "XC7A200T"},
// Kintex 7
{FPGA_ID_XC7K70T, "XC7K70T"},
{FPGA_ID_XC7K160T, "XC7K160T"},
{FPGA_ID_XC7K325T, "XC7K325T"},
{FPGA_ID_XC7K355T, "XC7K355T"},
{FPGA_ID_XC7K410T, "XC7K410T"},
{FPGA_ID_XC7K420T, "XC7K420T"},
{FPGA_ID_XC7K480T, "XC7K480T"},
// Virtex 7
{FPGA_ID_XC7V585T, "XC7V585T"},
{FPGA_ID_XC7V2000T, "XC7V2000T"},
{FPGA_ID_XC7VX330T, "XC7VX330T"},
{FPGA_ID_XC7VX415T, "XC7VX415T"},
{FPGA_ID_XC7VX485T, "XC7VX485T"},
{FPGA_ID_XC7VX550T, "XC7VX550T"},
{FPGA_ID_XC7VX690T, "XC7VX690T"},
{FPGA_ID_XC7VX980T, "XC7VX980T"},
{FPGA_ID_XC7VX1140T, "XC7VX1140T"},
{FPGA_ID_XC7VH580T, "XC7VH580T"},
{FPGA_ID_XC7VH870T, "XC7VH870T"},
// Kintex Ultrascale
{FPGA_ID_XCKU025, "XCKU025"},
{FPGA_ID_XCKU035, "XCKU035"},
{FPGA_ID_XCKU040, "XCKU040"},
{FPGA_ID_XCKU060, "XCKU060"},
{FPGA_ID_XCKU085, "XCKU085"},
{FPGA_ID_XCKU095, "XCKU095"},
{FPGA_ID_XCKU115, "XCKU115"},
// Virtex Ultrascale
{FPGA_ID_XCVU065, "XCVU065"},
{FPGA_ID_XCVU080, "XCVU080"},
{FPGA_ID_XCVU095, "XCVU095"},
{FPGA_ID_XCVU125, "XCVU125"},
{FPGA_ID_XCVU160, "XCVU160"},
{FPGA_ID_XCVU190, "XCVU190"},
{FPGA_ID_XCVU440, "XCVU440"},
// Kintex Ultrascale+
{FPGA_ID_XCKU3P, "XCKU3P"},
{FPGA_ID_XCKU5P, "XCKU5P"},
{FPGA_ID_XCKU9P, "XCKU9P"},
{FPGA_ID_XCKU11P, "XCKU11P"},
{FPGA_ID_XCKU13P, "XCKU13P"},
{FPGA_ID_XCKU15P, "XCKU15P"},
// Virtex Ultrascale+
{FPGA_ID_XCVU3P, "XCVU3P"},
{FPGA_ID_XCVU5P, "XCVU5P"},
{FPGA_ID_XCVU7P, "XCVU7P"},
{FPGA_ID_XCVU9P, "XCVU9P"},
{FPGA_ID_XCVU11P, "XCVU11P"},
{FPGA_ID_XCVU13P, "XCVU13P"},
// Zynq Ultrascale+
{FPGA_ID_XCZU2, "XCZU2"},
{FPGA_ID_XCZU3, "XCZU3"},
{FPGA_ID_XCZU4, "XCZU4"},
{FPGA_ID_XCZU5, "XCZU5"},
{FPGA_ID_XCZU6, "XCZU6"},
{FPGA_ID_XCZU7, "XCZU7"},
{FPGA_ID_XCZU9, "XCZU9"},
{FPGA_ID_XCZU11, "XCZU11"},
{FPGA_ID_XCZU15, "XCZU15"},
{FPGA_ID_XCZU17, "XCZU17"},
{FPGA_ID_XCZU19, "XCZU19"},
{FPGA_ID_XCZU21, "XCZU21"},
{FPGA_ID_XCZU25, "XCZU25"},
{FPGA_ID_XCZU27, "XCZU27"},
{FPGA_ID_XCZU28, "XCZU28"},
{FPGA_ID_XCZU29, "XCZU29"},
// Alveo
{FPGA_ID_XCU50, "XCU50"},
{FPGA_ID_XCU200, "XCU200"},
{FPGA_ID_XCU250, "XCU250"},
{FPGA_ID_XCU280, "XCU280"},
{0, ""}
};
const char *get_fpga_part(int id)
{
const struct fpga_id *ptr = fpga_id_list;
id = id & 0x0fffffff; // mask off version
while (ptr->id && ptr->id != id)
{
ptr++;
}
return ptr->part;
}

119
utils/fpga_id.h Normal file
View File

@ -0,0 +1,119 @@
/*
Copyright 2020, The Regents of the University of California.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE REGENTS OF THE UNIVERSITY OF CALIFORNIA ''AS
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OF THE UNIVERSITY OF CALIFORNIA OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of The Regents of the University of California.
*/
#ifndef FPGA_ID_H
#define FPGA_ID_H
// Artix 7
#define FPGA_ID_XC7A15T 0x362D093
#define FPGA_ID_XC7A35T 0x362D093
#define FPGA_ID_XC7A50T 0x362C093
#define FPGA_ID_XC7A75T 0x3632093
#define FPGA_ID_XC7A100T 0x3631093
#define FPGA_ID_XC7A200T 0x3636093
// Kintex 7
#define FPGA_ID_XC7K70T 0x3647093
#define FPGA_ID_XC7K160T 0x364C093
#define FPGA_ID_XC7K325T 0x3651093
#define FPGA_ID_XC7K355T 0x3747093
#define FPGA_ID_XC7K410T 0x3656093
#define FPGA_ID_XC7K420T 0x3752093
#define FPGA_ID_XC7K480T 0x3751093
// Virtex 7
#define FPGA_ID_XC7V585T 0x3671093
#define FPGA_ID_XC7V2000T 0x36B3093
#define FPGA_ID_XC7VX330T 0x3667093
#define FPGA_ID_XC7VX415T 0x3682093
#define FPGA_ID_XC7VX485T 0x3687093
#define FPGA_ID_XC7VX550T 0x3692093
#define FPGA_ID_XC7VX690T 0x3691093
#define FPGA_ID_XC7VX980T 0x3696093
#define FPGA_ID_XC7VX1140T 0x36D5093
#define FPGA_ID_XC7VH580T 0x36D9093
#define FPGA_ID_XC7VH870T 0x36DB093
// Kintex Ultrascale
#define FPGA_ID_XCKU025 0x3824093
#define FPGA_ID_XCKU035 0x3823093
#define FPGA_ID_XCKU040 0x3822093
#define FPGA_ID_XCKU060 0x3919093
#define FPGA_ID_XCKU085 0x380F093
#define FPGA_ID_XCKU095 0x3844093
#define FPGA_ID_XCKU115 0x390D093
// Virtex Ultrascale
#define FPGA_ID_XCVU065 0x3939093
#define FPGA_ID_XCVU080 0x3843093
#define FPGA_ID_XCVU095 0x3842093
#define FPGA_ID_XCVU125 0x392D093
#define FPGA_ID_XCVU160 0x3933093
#define FPGA_ID_XCVU190 0x3931093
#define FPGA_ID_XCVU440 0x396D093
// Kintex Ultrascale+
#define FPGA_ID_XCKU3P 0x4A63093
#define FPGA_ID_XCKU5P 0x4A62093
#define FPGA_ID_XCKU9P 0x484A093
#define FPGA_ID_XCKU11P 0x4A4E093
#define FPGA_ID_XCKU13P 0x4A52093
#define FPGA_ID_XCKU15P 0x4A56093
// Virtex Ultrascale+
#define FPGA_ID_XCVU3P 0x4B39093
#define FPGA_ID_XCVU5P 0x4B2B093
#define FPGA_ID_XCVU7P 0x4B29093
#define FPGA_ID_XCVU9P 0x4B31093
#define FPGA_ID_XCVU11P 0x4B49093
#define FPGA_ID_XCVU13P 0x4B51093
// Zynq Ultrascale+
#define FPGA_ID_XCZU2 0x4711093
#define FPGA_ID_XCZU3 0x4710093
#define FPGA_ID_XCZU4 0x4721093
#define FPGA_ID_XCZU5 0x4720093
#define FPGA_ID_XCZU6 0x4739093
#define FPGA_ID_XCZU7 0x4730093
#define FPGA_ID_XCZU9 0x4738093
#define FPGA_ID_XCZU11 0x4740093
#define FPGA_ID_XCZU15 0x4750093
#define FPGA_ID_XCZU17 0x4759093
#define FPGA_ID_XCZU19 0x4758093
#define FPGA_ID_XCZU21 0x47E1093
#define FPGA_ID_XCZU25 0x47E5093
#define FPGA_ID_XCZU27 0x47E4093
#define FPGA_ID_XCZU28 0x47E0093
#define FPGA_ID_XCZU29 0x47E2093
// Alveo
#define FPGA_ID_XCU50 0x4B77093
#define FPGA_ID_XCU200 0x4B37093
#define FPGA_ID_XCU250 0x4B57093
#define FPGA_ID_XCU280 0x4B7D093
const char *get_fpga_part(int id);
#endif /* FPGA_ID_H */