Skip to content

Commit

Permalink
Add LFD2NX-40 device
Browse files Browse the repository at this point in the history
Signed-off-by: David Shah <dave@ds0.me>
  • Loading branch information
gatecat committed Jun 25, 2020
1 parent 53864ba commit 2d58b82
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 4 deletions.
2 changes: 1 addition & 1 deletion database
13 changes: 13 additions & 0 deletions devices.json
Expand Up @@ -14,6 +14,19 @@
"max_col" : 87,
"col_bias" : 0,
"fuzz": true
},
"LFD2NX-40": {
"packages": ["caBGA256"],
"idcode": 823070787,
"frames": 9172,
"bits_per_frame": 662,
"pad_bits_after_frame": 0,
"pad_bits_before_frame": 4,
"frame_ecc_bits": 14,
"max_row" : 56,
"max_col" : 87,
"col_bias" : 0,
"fuzz": true
}
}
}
Expand Down
32 changes: 31 additions & 1 deletion libprjoxide/src/database_html.rs
Expand Up @@ -2,7 +2,7 @@ use crate::bels::*;
use crate::database::*;
use crate::docs::{md_file_to_html, md_to_html};
use std::cmp::{max, min};
use std::collections::BTreeSet;
use std::collections::{BTreeSet, BTreeMap};
use std::fs::File;
use std::io::Write;
use std::iter::FromIterator;
Expand Down Expand Up @@ -513,6 +513,36 @@ pub fn write_bits_html(
writeln!(html, "</body></html>").unwrap();
}

pub fn write_ip_html(db: &mut Database,
fam: &str,
iptype: &str,
filepath: &str) {
let mut html = File::create(filepath).unwrap();
let bitdb = &db.ip_bitdb(fam, iptype).db;
writeln!(
html,
"<html> \n\
<head>\n\
<title>{it} IP Register Map</title>\n\
</head>\n\
<body>\n\
<h1>{it} IP Register Map</h1>\n\
",
it = iptype
)
.unwrap();
writeln!(html, "<table>").unwrap();
writeln!(html, "<tr><th>Address</th>").unwrap();
for i in 0..8 {
writeln!(html, "<th>{}</th>", i).unwrap();
}
writeln!(html, "</tr>").unwrap();
let mut bit2func = BTreeMap::<(u32, u8), (&str, usize, &str)>::new();

writeln!(html, "</table>").unwrap();
writeln!(html, "</body></html>").unwrap();
}

pub fn write_bel_html(docs_root: &str, tiletype: &str, bel: &Bel, filepath: &str) {
// Write out prelude HTML
let mut html = File::create(filepath).unwrap();
Expand Down
8 changes: 7 additions & 1 deletion radiant.sh
@@ -1,6 +1,6 @@
#!/bin/bash

radiantdir="${RADIANTDIR:-$HOME/lscc/radiant/2.0}"
radiantdir="${RADIANTDIR:-$HOME/lscc/radiant/2.1}"
export FOUNDRY="${radiantdir}/ispfpga"
bindir="${radiantdir}/bin/lin64"
LSC_DIAMOND=true
Expand All @@ -25,6 +25,12 @@ case "${PART}" in
LSE_ARCH="lifcl"
SPEED_GRADE="${SPEED_GRADE:-7_High-Performance_1.0V}"
;;
LFD2NX-40)
PACKAGE="${DEV_PACKAGE:-CABGA256}"
DEVICE="LFD2NX-40"
LSE_ARCH="lfd2nx"
SPEED_GRADE="${SPEED_GRADE:-7_High-Performance_1.0V}"
;;
esac

SCRIPT_PATH=$(readlink -f "${BASH_SOURCE:-$0}")
Expand Down
2 changes: 1 addition & 1 deletion tools/fixup_io_tilegrid.py
Expand Up @@ -10,7 +10,7 @@
This script fixes this by patching tile names
"""

for f, d in [("LIFCL", "LIFCL-40")]:
for f, d in [("LIFCL", "LIFCL-40"), ("LIFCL", "LFD2NX-40")]:
tgp = path.join(database.get_db_root(), f, d, "tilegrid.json")
with open(tgp, "r") as infile:
tg = json.load(infile)["tiles"]
Expand Down

0 comments on commit 2d58b82

Please sign in to comment.