ice40: lower fuzz size to improve patcher reliability
The fuzz size should be made smaller, because we're getting too many false positives. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
d2b4ff089d
commit
ea6c170023
12
ice40.c
12
ice40.c
@ -5,6 +5,10 @@
|
|||||||
#define MAX(x, y) (x) > (y) ? (x) : (y)
|
#define MAX(x, y) (x) > (y) ? (x) : (y)
|
||||||
#define DEBUG_PRINT(...)
|
#define DEBUG_PRINT(...)
|
||||||
|
|
||||||
|
// The number of words forward and backward to look for matches.
|
||||||
|
// Should be at least 16.
|
||||||
|
#define DIFF_FUZZ 32
|
||||||
|
|
||||||
struct Ice40Bitstream
|
struct Ice40Bitstream
|
||||||
{
|
{
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
@ -295,12 +299,12 @@ int ice40_patch(struct irw_file *f, struct irw_file *rom,
|
|||||||
|
|
||||||
if (word) {
|
if (word) {
|
||||||
int found = 0;
|
int found = 0;
|
||||||
int start = ora_ptr - 64;
|
int start = ora_ptr - DIFF_FUZZ;
|
||||||
int end = ora_ptr + 64;
|
int end = ora_ptr + DIFF_FUZZ;
|
||||||
if (start < 0)
|
if (start < 0)
|
||||||
start = 0;
|
start = 0;
|
||||||
if (end > 8192)
|
if (end > (byte_count - 1))
|
||||||
end = 8192;
|
end = (byte_count - 1);
|
||||||
for (i = start; i < end; i++) {
|
for (i = start; i < end; i++) {
|
||||||
if (ora16[i] == word) {
|
if (ora16[i] == word) {
|
||||||
found = 1;
|
found = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user