mirror of https://github.com/YosysHQ/icestorm.git
Merge 6de4d5cec6 into f31c39cc2e
This commit is contained in:
commit
60331cf5bc
|
|
@ -122,7 +122,7 @@ struct FpgaConfig
|
||||||
void write_bits(std::ostream &ofs) const;
|
void write_bits(std::ostream &ofs) const;
|
||||||
|
|
||||||
// icebox i/o
|
// icebox i/o
|
||||||
void read_ascii(std::istream &ifs, bool nosleep);
|
void read_ascii(std::istream &ifs, bool nosleep, const std::string& freqrange);
|
||||||
void write_ascii(std::ostream &ofs) const;
|
void write_ascii(std::ostream &ofs) const;
|
||||||
|
|
||||||
// netpbm i/o
|
// netpbm i/o
|
||||||
|
|
@ -612,7 +612,7 @@ void FpgaConfig::write_bits(std::ostream &ofs) const
|
||||||
write_byte(ofs, crc_value, file_offset, 0x00);
|
write_byte(ofs, crc_value, file_offset, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep)
|
void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep, const std::string& freqrange)
|
||||||
{
|
{
|
||||||
debug("## %s\n", __PRETTY_FUNCTION__);
|
debug("## %s\n", __PRETTY_FUNCTION__);
|
||||||
info("Parsing ascii file..\n");
|
info("Parsing ascii file..\n");
|
||||||
|
|
@ -620,7 +620,7 @@ void FpgaConfig::read_ascii(std::istream &ifs, bool nosleep)
|
||||||
bool got_device = false;
|
bool got_device = false;
|
||||||
this->cram.clear();
|
this->cram.clear();
|
||||||
this->bram.clear();
|
this->bram.clear();
|
||||||
this->freqrange = "low";
|
this->freqrange = freqrange;
|
||||||
this->warmboot = "enabled";
|
this->warmboot = "enabled";
|
||||||
|
|
||||||
bool reuse_line = true;
|
bool reuse_line = true;
|
||||||
|
|
@ -1361,6 +1361,9 @@ void usage(const char *cmd)
|
||||||
log(" -B0, -B1, -B2, -B3\n");
|
log(" -B0, -B1, -B2, -B3\n");
|
||||||
log(" only include the specified bank in the netpbm file\n");
|
log(" only include the specified bank in the netpbm file\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
log(" -Fl, -Fm, -Fh\n");
|
||||||
|
log(" set the frequency range of the internal oscillator (low, medium, high)\n");
|
||||||
|
log("\n");
|
||||||
log(" -n\n");
|
log(" -n\n");
|
||||||
log(" skip initializing BRAM\n");
|
log(" skip initializing BRAM\n");
|
||||||
log("\n");
|
log("\n");
|
||||||
|
|
@ -1391,6 +1394,7 @@ int main(int argc, char **argv)
|
||||||
bool skip_bram_initialization = false;
|
bool skip_bram_initialization = false;
|
||||||
int netpbm_banknum = -1;
|
int netpbm_banknum = -1;
|
||||||
int checkerboard_m = 1;
|
int checkerboard_m = 1;
|
||||||
|
std::string freqrange = "low";
|
||||||
|
|
||||||
for (int i = 0; argv[0][i]; i++)
|
for (int i = 0; argv[0][i]; i++)
|
||||||
if (string(argv[0]+i) == "iceunpack")
|
if (string(argv[0]+i) == "iceunpack")
|
||||||
|
|
@ -1425,6 +1429,16 @@ int main(int argc, char **argv)
|
||||||
log_level++;
|
log_level++;
|
||||||
} else if (arg[i] == 'n') {
|
} else if (arg[i] == 'n') {
|
||||||
skip_bram_initialization = true;
|
skip_bram_initialization = true;
|
||||||
|
} else if (arg[i] == 'F') {
|
||||||
|
char speed = arg[++i];
|
||||||
|
if (speed == 'l')
|
||||||
|
freqrange = "low";
|
||||||
|
else if (speed == 'm')
|
||||||
|
freqrange = "medium";
|
||||||
|
else if (speed == 'h')
|
||||||
|
freqrange = "high";
|
||||||
|
else
|
||||||
|
usage(argv[0]);
|
||||||
} else
|
} else
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1462,14 +1476,14 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
FpgaConfig fpga_config;
|
FpgaConfig fpga_config;
|
||||||
|
|
||||||
fpga_config.skip_bram_initialization = skip_bram_initialization;
|
fpga_config.skip_bram_initialization = skip_bram_initialization;
|
||||||
|
|
||||||
if (unpack_mode) {
|
if (unpack_mode) {
|
||||||
fpga_config.read_bits(*isp);
|
fpga_config.read_bits(*isp);
|
||||||
if (!netpbm_mode)
|
if (!netpbm_mode)
|
||||||
fpga_config.write_ascii(*osp);
|
fpga_config.write_ascii(*osp);
|
||||||
} else {
|
} else {
|
||||||
fpga_config.read_ascii(*isp, nosleep_mode);
|
fpga_config.read_ascii(*isp, nosleep_mode, freqrange);
|
||||||
if (!netpbm_mode)
|
if (!netpbm_mode)
|
||||||
fpga_config.write_bits(*osp);
|
fpga_config.write_bits(*osp);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue