mirror of https://github.com/openXC7/prjxray.git
Update picorv32 experiment and bitread.cc
Signed-off-by: Clifford Wolf <clifford@clifford.at> Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
This commit is contained in:
parent
1f6ec8ca21
commit
bbdce157c5
|
|
@ -1,7 +1,11 @@
|
|||
/.Xil/
|
||||
/design/
|
||||
/design.log
|
||||
/design.tcl
|
||||
/design.xdc
|
||||
/design/
|
||||
/design.bit
|
||||
/design.bits
|
||||
/design.dcp
|
||||
/lutlist.txt
|
||||
/vivado.jou
|
||||
/vivado.log
|
||||
|
|
|
|||
|
|
@ -10,16 +10,12 @@ set_property -dict {PACKAGE_PIN $XRAY_PIN_01 IOSTANDARD LVCMOS33} [get_ports din
|
|||
set_property -dict {PACKAGE_PIN $XRAY_PIN_02 IOSTANDARD LVCMOS33} [get_ports dout]
|
||||
set_property -dict {PACKAGE_PIN $XRAY_PIN_03 IOSTANDARD LVCMOS33} [get_ports stb]
|
||||
|
||||
# set_property LOCK_PINS {I0:A1} [get_cells -quiet -filter {REF_NAME == LUT1} -hierarchical]
|
||||
# set_property LOCK_PINS {I0:A1 I1:A2} [get_cells -quiet -filter {REF_NAME == LUT2} -hierarchical]
|
||||
# set_property LOCK_PINS {I0:A1 I1:A2 I2:A3} [get_cells -quiet -filter {REF_NAME == LUT3} -hierarchical]
|
||||
# set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4} [get_cells -quiet -filter {REF_NAME == LUT4} -hierarchical]
|
||||
# set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4 I4:A5} [get_cells -quiet -filter {REF_NAME == LUT5} -hierarchical]
|
||||
# set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4 I4:A5 I5:A6} [get_cells -quiet -filter {REF_NAME == LUT6} -hierarchical]
|
||||
set_property LOCK_PINS {I0:A1 I1:A2 I2:A3 I3:A4 I4:A5 I5:A6} \
|
||||
[get_cells -quiet -filter {REF_NAME == LUT6} -hierarchical]
|
||||
|
||||
create_pblock pblock_1
|
||||
add_cells_to_pblock [get_pblocks pblock_1] [get_cells -quiet [list picorv32]]
|
||||
resize_pblock [get_pblocks pblock_1] -add {$XRAY_ROI}
|
||||
create_pblock roi
|
||||
add_cells_to_pblock [get_pblocks roi] [get_cells -quiet [list picorv32]]
|
||||
resize_pblock [get_pblocks roi] -add {$XRAY_ROI}
|
||||
|
||||
set_property CFGBVS VCCO [current_design]
|
||||
set_property CONFIG_VOLTAGE 3.3 [current_design]
|
||||
|
|
@ -41,8 +37,21 @@ route_design
|
|||
|
||||
write_checkpoint -force design.dcp
|
||||
write_bitstream -force design.bit
|
||||
|
||||
puts "Writing lutlist.txt."
|
||||
current_instance picorv32
|
||||
set fp [open "lutlist.txt" w]
|
||||
set luts [get_cells -filter {REF_NAME == LUT6}]
|
||||
foreach lut $luts {
|
||||
set bel [get_property BEL $lut]
|
||||
set loc [get_property LOC $lut]
|
||||
set init [get_property INIT $lut]
|
||||
puts $fp "$loc $bel $init"
|
||||
}
|
||||
close $fp
|
||||
EOT
|
||||
|
||||
rm -rf design design.log
|
||||
vivado -nojournal -log design.log -mode batch -source design.tcl
|
||||
../tools/bitread -o design.bits -zy < design.bit
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ bool mode_c = false;
|
|||
bool mode_r = false;
|
||||
bool mode_m = false;
|
||||
bool mode_x = false;
|
||||
bool mode_y = false;
|
||||
bool mode_z = false;
|
||||
bool chksum = false;
|
||||
char *outfile = nullptr;
|
||||
|
|
@ -224,7 +225,7 @@ public:
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "crmxzCf:o:")) != -1)
|
||||
while ((opt = getopt(argc, argv, "crmxyzCf:o:")) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case 'c':
|
||||
|
|
@ -239,6 +240,9 @@ int main(int argc, char **argv)
|
|||
case 'x':
|
||||
mode_x = true;
|
||||
break;
|
||||
case 'y':
|
||||
mode_y = true;
|
||||
break;
|
||||
case 'z':
|
||||
mode_z = true;
|
||||
break;
|
||||
|
|
@ -275,6 +279,9 @@ help:
|
|||
fprintf(stderr, " -x\n");
|
||||
fprintf(stderr, " use format 'bit_%%08x_%%02x_%%02x_t%%d_h%%d_r%%d_c%%d_m%%d_w%%d_b%%d'\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, " -y\n");
|
||||
fprintf(stderr, " use format 'bit_%%08x_%%02x_%%02x'\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, " -C\n");
|
||||
fprintf(stderr, " do not ignore the checksum in each frame\n");
|
||||
fprintf(stderr, "\n");
|
||||
|
|
@ -513,14 +520,18 @@ help:
|
|||
}
|
||||
|
||||
|
||||
if (mode_x)
|
||||
if (mode_x || mode_y)
|
||||
{
|
||||
for (int i = 0; i < 101; i++)
|
||||
for (int k = 0; k < 32; k++)
|
||||
if ((i != 50 || chksum) && ((it.second.at(i) & (1 << k)) != 0))
|
||||
fprintf(f, "bit_%08x_%02x_%02x_t%d_h%d_r%d_c%d_m%d_w%d_b%d\n",
|
||||
fid.get_value(), i, k, fid.get_type(), fid.get_topflag(), fid.get_rowaddr(),
|
||||
fid.get_coladdr(), fid.get_minor(), i, k);
|
||||
if ((i != 50 || chksum) && ((it.second.at(i) & (1 << k)) != 0)) {
|
||||
if (mode_x)
|
||||
fprintf(f, "bit_%08x_%02x_%02x_t%d_h%d_r%d_c%d_m%d_w%d_b%d\n",
|
||||
fid.get_value(), i, k, fid.get_type(), fid.get_topflag(), fid.get_rowaddr(),
|
||||
fid.get_coladdr(), fid.get_minor(), i, k);
|
||||
else
|
||||
fprintf(f, "bit_%08x_%02x_%02x\n", fid.get_value(), i, k);
|
||||
}
|
||||
if (outfile == nullptr)
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue