-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vlog95: block generating a concat-Z LPM device in the compiler.
Since the vlog95 code generator needs the strength information we do not want to hide it behind a concat-Z optimization. For now we abort the optimization, but in the future we could add parts of this back in (e.g. all the drivers have matching strength then replace with a normal concat and a buf-Z if the strength are not both strong. The original buf-Z should be removed to reduce the number of LPM devices).
- Loading branch information
Showing
6 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#ifndef __compiler_H | ||
#define __compiler_H | ||
/* | ||
* Copyright (c) 1999-2011 Stephen Williams ([email protected]) | ||
* Copyright (c) 1999-2013 Stephen Williams ([email protected]) | ||
* | ||
* This source code is free software; you can redistribute it | ||
* and/or modify it in source code form under the terms of the GNU | ||
|
@@ -107,6 +107,10 @@ extern bool debug_optimizer; | |
/* Possibly temporary flag to control virtualization of pin arrays */ | ||
extern bool disable_virtual_pins; | ||
|
||
/* The vlog95 code generator does not want the compiler to generate concat-Z | ||
* LPM objects so this flag is used to block them from being generated. */ | ||
extern bool disable_concatz_generation; | ||
|
||
/* Limit to size of devirtualized arrays */ | ||
extern unsigned long array_size_limit; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
const char COPYRIGHT[] = | ||
"Copyright (c) 1998-2012 Stephen Williams ([email protected])"; | ||
"Copyright (c) 1998-2013 Stephen Williams ([email protected])"; | ||
|
||
/* | ||
* This source code is free software; you can redistribute it | ||
|
@@ -175,6 +175,7 @@ bool debug_optimizer = false; | |
bool disable_virtual_pins = false; | ||
unsigned long array_size_limit = 16777216; // Minimum required by IEEE-1364? | ||
unsigned recursive_mod_limit = 10; | ||
bool disable_concatz_generation = false; | ||
|
||
/* | ||
* Verbose messages enabled. | ||
|
@@ -967,6 +968,9 @@ int main(int argc, char*argv[]) | |
flag_tmp = flags["RECURSIVE_MOD_LIMIT"]; | ||
if (flag_tmp) recursive_mod_limit = strtoul(flag_tmp,NULL,0); | ||
|
||
flag_tmp = flags["DISABLE_CONCATZ_GENERATION"]; | ||
if (flag_tmp) disable_concatz_generation = strcmp(flag_tmp,"true")==0; | ||
|
||
/* Parse the input. Make the pform. */ | ||
pform_set_timescale(def_ts_units, def_ts_prec, 0, 0); | ||
int rc = pform_parse(argv[optind]); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2001-2012 Stephen Williams ([email protected]) | ||
* Copyright (c) 2001-2013 Stephen Williams ([email protected]) | ||
* | ||
* This source code is free software; you can redistribute it | ||
* and/or modify it in source code form under the terms of the GNU | ||
|
@@ -1127,6 +1127,17 @@ void collapse_partselect_pv_to_concat(Design*des, NetNet*sig) | |
|
||
ivl_assert(*sig, idx == ps_map.size()); | ||
|
||
/* The vlog95 and possibly other code generators do not want | ||
* to have a group of part selects turned into a transparent | ||
* concatenation. */ | ||
if (disable_concatz_generation) { | ||
// HERE: If the part selects have matching strengths then we can use | ||
// a normal concat with a buf-Z after if the strengths are not | ||
// both strong. We would ideally delete any buf-Z driving the | ||
// concat, but that is not required for the vlog95 generator. | ||
return; | ||
} | ||
|
||
// Ah HAH! The NetPartSelect::PV objects exactly cover the | ||
// target signal. We can replace all of them with a single | ||
// concatenation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ functor:synth2 | |
functor:synth | ||
functor:syn-rules | ||
flag:DLL=vlog95.tgt | ||
flag:DISABLE_CONCATZ_GENERATION=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
flag:DLL=vlog95.tgt | ||
flag:DISABLE_CONCATZ_GENERATION=true |