OpenSTA/power/SaifReader.cc

228 lines
6.0 KiB
C++
Raw Normal View History

2024-09-24 03:04:26 +02:00
// OpenSTA, Static Timing Analyzer
// Copyright (c) 2025, Parallax Software, Inc.
2024-09-24 03:04:26 +02:00
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//
// The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software.
//
// Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// This notice may not be removed or altered from any source distribution.
2024-09-24 03:04:26 +02:00
#include "power/SaifReader.hh"
#include <algorithm>
#include <cinttypes>
2024-09-24 03:04:26 +02:00
#include "Error.hh"
#include "Debug.hh"
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
#include "Stats.hh"
2024-09-24 03:04:26 +02:00
#include "Report.hh"
#include "Network.hh"
read_vcd, report_activity_annotation resolves #162 resolves $158 commit 02be8357f8ba158292faab0e8d8b8d220e69c842 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 15 15:59:20 2025 -0700 sort regressions Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b0e1d863d34853b70d342c6bb0baa400a08db207 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 15 15:44:07 2025 -0700 PowerResult::incf* Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 23ed0ed05d8bbf83cc5b6fa7598f1253cbe2b222 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 12 17:49:24 2025 -0700 gzip vcd/saif Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a5a1a7b80e00b2deb51505b2e60312e3c29284fe Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 12 17:12:09 2025 -0700 report_activity_annotation sort pins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6c149cc6d66addda4eee5f56dbe4731876f1efa9 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 12 16:47:02 2025 -0700 vcd/saif do not annotate internal pins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit fe8c7c7fc7b2878cb16c7d2a57e1161555f9a36f Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 11 17:09:22 2025 -0700 report_activity_annotation Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8a8f87ba05c6c6f31017288d573c23e92cac4f9e Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 10 11:57:22 2025 -0700 ReadVcdActivies factor VcdCountReader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit aa70ae987c4a749e53ae2f93c8ff04a3c28b0b08 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 10 09:06:09 2025 -0700 vcd high time Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 242493e992949ee72493f4f15a0fe92630ad2f03 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 17:14:02 2025 -0700 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8621a83d7abf5efcf54c24a1a16bba0c8eb5e441 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 17:11:22 2025 -0700 ReadVcdActivities rm sta_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit fc0327c39c5aef6d09580795f6a13abf9b9f8266 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 09:36:30 2025 -0700 var name Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a5b6e2ac66cef9355a9a87edcc185b483f5781ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 08:23:50 2025 -0700 vcd passes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c0f6d268542b3dd431882cfa4e3d131d6d2fb933 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 20:19:27 2025 -0700 vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8181e206ee39e4c3fdd69ef1d3463092763c3d2b Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 19:41:59 2025 -0700 vcd debug Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 652736654b853d1f7fb64545c6a48500e1e3b83f Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 19:17:06 2025 -0700 vcd bus support Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 03c877512d92b0148fd62cbc636da58ef6fb25ff Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 19:11:21 2025 -0700 vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 53bbd97a28d619ca87a546f34a3643c227b9df78 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 16:02:47 2025 -0700 rm Vcd structs, ReadVcdActivities -> VcdReader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 745efff41221c3b06ba19931e4f8a58e5b0758ae Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 15:46:49 2025 -0700 vcd skip hpins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a9a6177e8b671f0619809611984ed16f2d1a5b7a Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 15:39:41 2025 -0700 ReadVcdActivies rm vcd_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8b51b13b02c257d10385312d246e0da1f11b72f2 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 15:28:31 2025 -0700 power_vcd1 passes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 744669797d1a4189c417d9d2f359cbd1f5bc7113 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 10:16:35 2025 -0700 vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0f0aeac1cd8349302b758ce4b79fd753063565f2 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 6 16:20:13 2025 -0800 vcd reader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 01d296ce9b3ad8ac7e6dddf28a41a718b4138869 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 5 16:08:41 2025 -0800 vcd rm max_var_width Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 9ffdb19074e5c38464b88ead0ec751ae7d3c506c Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 5 16:03:06 2025 -0800 vcd rm max_var_name_length_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5c577143d4a166bd133a9d97d1761b52b8e122dd Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 5 15:58:29 2025 -0800 ReadVcdActivities isa VcdReader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6914405d0799b967a92634fe1aa251aaea4cdfbc Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 4 17:24:57 2025 -0800 vcd parse rm StaState dependence Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a0bd7aa5eee2e87c883776bf4840d117335e4a8b Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 4 16:41:55 2025 -0800 vcd headers Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4842d19d7a5c47d6ee46f297cb9404ab77fe2662 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 4 15:59:46 2025 -0800 refactor vcd parser Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-01-16 00:20:21 +01:00
#include "PortDirection.hh"
2024-09-24 03:04:26 +02:00
#include "Sdc.hh"
#include "Power.hh"
#include "power/SaifReaderPvt.hh"
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
#include "power/SaifScanner.hh"
2024-09-24 03:04:26 +02:00
#include "Sta.hh"
namespace sta {
using std::string;
2024-09-24 03:04:26 +02:00
using std::min;
bool
readSaif(const char *filename,
const char *scope,
Sta *sta)
{
SaifReader reader(filename, scope, sta);
bool success = reader.read();
return success;
}
SaifReader::SaifReader(const char *filename,
const char *scope,
Sta *sta) :
StaState(sta),
filename_(filename),
scope_(scope),
divider_('/'),
escape_('\\'),
timescale_(1.0E-9F), // default units of ns
duration_(0.0),
in_scope_level_(0),
power_(sta->power())
{
}
bool
SaifReader::read()
{
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
gzstream::igzstream stream(filename_);
if (stream.is_open()) {
Stats stats(debug_, report_);
SaifScanner scanner(&stream, filename_, this, report_);
SaifParse parser(&scanner, this);
2024-09-24 03:04:26 +02:00
// yyparse returns 0 on success.
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
bool success = (parser.parse() == 0);
report_->reportLine("Annotated %zu pin activities.", annotated_pins_.size());
2024-09-24 03:04:26 +02:00
return success;
}
else
throw FileNotReadable(filename_);
}
void
SaifReader::setDivider(char divider)
{
divider_ = divider;
}
void
SaifReader::setTimescale(uint64_t multiplier,
const char *units)
{
if (multiplier == 1
|| multiplier == 10
|| multiplier == 100) {
if (stringEq(units, "us"))
timescale_ = multiplier * 1E-6;
else if (stringEq(units, "ns"))
timescale_ = multiplier * 1E-9;
else if (stringEq(units, "ps"))
timescale_ = multiplier * 1E-12;
else if (stringEq(units, "fs"))
timescale_ = multiplier * 1E-15;
else
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
report_->error(180, "SAIF TIMESCALE units not us, ns, or ps.");
2024-09-24 03:04:26 +02:00
}
else
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
report_->error(181, "SAIF TIMESCALE multiplier not 1, 10, or 100.");
2024-09-24 03:04:26 +02:00
stringDelete(units);
}
void
SaifReader::setDuration(uint64_t duration)
{
duration_ = duration;
}
void
SaifReader::instancePush(const char *instance_name)
{
if (in_scope_level_ == 0) {
// Check for a match to the annotation scope.
saif_scope_.push_back(instance_name);
string saif_scope;
bool first = true;
for (string &inst : saif_scope_) {
if (!first)
saif_scope += sdc_network_->pathDivider();
2024-09-24 03:04:26 +02:00
saif_scope += inst;
first = false;
}
if (stringEq(saif_scope.c_str(), scope_))
in_scope_level_ = saif_scope_.size();
}
else {
// Inside annotation scope.
Instance *parent = path_.empty() ? sdc_network_->topInstance() : path_.back();
Instance *child = sdc_network_->findChild(parent, instance_name);
2024-09-24 03:04:26 +02:00
path_.push_back(child);
}
stringDelete(instance_name);
}
void
SaifReader::instancePop()
{
if (in_scope_level_ == 0)
saif_scope_.pop_back();
if (!path_.empty())
path_.pop_back();
if (saif_scope_.size() < in_scope_level_)
in_scope_level_ = 0;
}
void
SaifReader::setNetDurations(const char *net_name,
SaifStateDurations &durations)
{
if (in_scope_level_ > 0) {
Instance *parent = path_.empty() ? sdc_network_->topInstance() : path_.back();
2024-09-24 03:04:26 +02:00
if (parent) {
string unescaped_name = unescaped(net_name);
const Pin *pin = sdc_network_->findPin(parent, unescaped_name.c_str());
read_vcd, report_activity_annotation resolves #162 resolves $158 commit 02be8357f8ba158292faab0e8d8b8d220e69c842 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 15 15:59:20 2025 -0700 sort regressions Signed-off-by: James Cherry <cherry@parallaxsw.com> commit b0e1d863d34853b70d342c6bb0baa400a08db207 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 15 15:44:07 2025 -0700 PowerResult::incf* Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 23ed0ed05d8bbf83cc5b6fa7598f1253cbe2b222 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 12 17:49:24 2025 -0700 gzip vcd/saif Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a5a1a7b80e00b2deb51505b2e60312e3c29284fe Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 12 17:12:09 2025 -0700 report_activity_annotation sort pins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6c149cc6d66addda4eee5f56dbe4731876f1efa9 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 12 16:47:02 2025 -0700 vcd/saif do not annotate internal pins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit fe8c7c7fc7b2878cb16c7d2a57e1161555f9a36f Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 11 17:09:22 2025 -0700 report_activity_annotation Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8a8f87ba05c6c6f31017288d573c23e92cac4f9e Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 10 11:57:22 2025 -0700 ReadVcdActivies factor VcdCountReader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit aa70ae987c4a749e53ae2f93c8ff04a3c28b0b08 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 10 09:06:09 2025 -0700 vcd high time Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 242493e992949ee72493f4f15a0fe92630ad2f03 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 17:14:02 2025 -0700 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8621a83d7abf5efcf54c24a1a16bba0c8eb5e441 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 17:11:22 2025 -0700 ReadVcdActivities rm sta_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit fc0327c39c5aef6d09580795f6a13abf9b9f8266 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 09:36:30 2025 -0700 var name Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a5b6e2ac66cef9355a9a87edcc185b483f5781ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 9 08:23:50 2025 -0700 vcd passes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c0f6d268542b3dd431882cfa4e3d131d6d2fb933 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 20:19:27 2025 -0700 vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8181e206ee39e4c3fdd69ef1d3463092763c3d2b Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 19:41:59 2025 -0700 vcd debug Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 652736654b853d1f7fb64545c6a48500e1e3b83f Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 19:17:06 2025 -0700 vcd bus support Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 03c877512d92b0148fd62cbc636da58ef6fb25ff Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 19:11:21 2025 -0700 vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 53bbd97a28d619ca87a546f34a3643c227b9df78 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 16:02:47 2025 -0700 rm Vcd structs, ReadVcdActivities -> VcdReader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 745efff41221c3b06ba19931e4f8a58e5b0758ae Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 15:46:49 2025 -0700 vcd skip hpins Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a9a6177e8b671f0619809611984ed16f2d1a5b7a Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 15:39:41 2025 -0700 ReadVcdActivies rm vcd_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8b51b13b02c257d10385312d246e0da1f11b72f2 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 15:28:31 2025 -0700 power_vcd1 passes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 744669797d1a4189c417d9d2f359cbd1f5bc7113 Author: James Cherry <cherry@parallaxsw.com> Date: Wed Jan 8 10:16:35 2025 -0700 vcd Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 0f0aeac1cd8349302b758ce4b79fd753063565f2 Author: James Cherry <cherry@parallaxsw.com> Date: Mon Jan 6 16:20:13 2025 -0800 vcd reader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 01d296ce9b3ad8ac7e6dddf28a41a718b4138869 Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 5 16:08:41 2025 -0800 vcd rm max_var_width Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 9ffdb19074e5c38464b88ead0ec751ae7d3c506c Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 5 16:03:06 2025 -0800 vcd rm max_var_name_length_ Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5c577143d4a166bd133a9d97d1761b52b8e122dd Author: James Cherry <cherry@parallaxsw.com> Date: Sun Jan 5 15:58:29 2025 -0800 ReadVcdActivities isa VcdReader Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 6914405d0799b967a92634fe1aa251aaea4cdfbc Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 4 17:24:57 2025 -0800 vcd parse rm StaState dependence Signed-off-by: James Cherry <cherry@parallaxsw.com> commit a0bd7aa5eee2e87c883776bf4840d117335e4a8b Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 4 16:41:55 2025 -0800 vcd headers Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 4842d19d7a5c47d6ee46f297cb9404ab77fe2662 Author: James Cherry <cherry@parallaxsw.com> Date: Sat Jan 4 15:59:46 2025 -0800 refactor vcd parser Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-01-16 00:20:21 +01:00
if (pin
&& !sdc_network_->isHierarchical(pin)
&& !sdc_network_->direction(pin)->isInternal()) {
2024-09-24 03:04:26 +02:00
double t1 = durations[static_cast<int>(SaifState::T1)];
float duty = t1 / duration_;
double tc = durations[static_cast<int>(SaifState::TC)];
float density = tc / (duration_ * timescale_);
2024-09-24 03:04:26 +02:00
debugPrint(debug_, "read_saif", 2,
"%s duty %.0f / %" PRIu64 " = %.2f tc %.0f density %.2f",
2024-09-24 03:04:26 +02:00
sdc_network_->pathName(pin),
t1,
duration_,
duty,
tc,
density);
power_->setUserActivity(pin, density, duty, PwrActivityOrigin::saif);
2024-09-24 03:04:26 +02:00
annotated_pins_.insert(pin);
}
}
}
stringDelete(net_name);
2024-09-24 03:04:26 +02:00
}
string
2024-09-24 03:04:26 +02:00
SaifReader::unescaped(const char *token)
{
string unescaped;
for (const char *t = token; *t; t++) {
char ch = *t;
if (ch != escape_)
2024-09-24 03:04:26 +02:00
// Just the normal noises.
unescaped += ch;
2024-09-24 03:04:26 +02:00
}
debugPrint(debug_, "saif_name", 1, "token %s -> %s", token, unescaped.c_str());
2024-09-24 03:04:26 +02:00
return unescaped;
}
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
////////////////////////////////////////////////////////////////
2024-09-24 03:04:26 +02:00
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
SaifScanner::SaifScanner(std::istream *stream,
const string &filename,
SaifReader *reader,
Report *report) :
yyFlexLexer(stream),
filename_(filename),
reader_(reader),
report_(report)
2024-09-24 03:04:26 +02:00
{
}
void
LibExpr/spef/saif c++ parsers commit a686a6f77e555513adc40228471c1ad1af4646b3 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:44 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 986a3a00c246a927c494066c56bb627e55da8692 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 18:45:32 2025 -0800 spef compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e8664d21c0b404a82967201c19a087c6680b7177 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 16:36:19 2025 -0800 saif compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 496569018791bff19e57c534f29ac085520fc520 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 15:25:44 2025 -0800 mv bison error funcs to .yy Signed-off-by: James Cherry <cherry@parallaxsw.com> commit c1e7638840f94eb0baddee47507e607b000ab858 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:26 2025 -0800 parser cledanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 22bc72af46114ddb4fc5876655887ef1189f2195 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 14:19:06 2025 -0800 parser cleanup Signed-off-by: James Cherry <cherry@parallaxsw.com> commit caeedc4c9e2bf8e7a2f4aceb4ee4a5758efd1b36 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:52:55 2025 -0800 LibertyParser stack stream Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e029a01c2fc5ba0ed336978c5853d49095d07d66 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:10:35 2025 -0800 bison 3.2 required Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 2ca9423a2d518f51fdee6c41d41348dbfd548bae Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 12:05:19 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit d64df413675c2978c0f24d5594cc201032233447 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 11:18:05 2025 -0800 LibertyExpr -> LibExpr Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 57cfbae240984bd7928862b1d6c3b1047ee5d71f Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:25:49 2025 -0800 comment Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 5249ac32d809ba30ce09437d61beaf4360bc2cd8 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:24:35 2025 -0800 parseError Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 8c5442007f99c06bfb16a496e00862353c82282c Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:11:46 2025 -0800 libecxpr parseError unused Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 67dacf60db2c0d7e3f7ceeae672b4bdaf1e039b7 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 10:09:39 2025 -0800 reader pvt includes Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 1d7097399b4242833bf5a478c903b5d98afe674b Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:33:37 2025 -0800 libexpr life Signed-off-by: James Cherry <cherry@parallaxsw.com> commit cc85e357463399291cb1e7d7b628e5dd356ac8a9 Author: James Cherry <cherry@parallaxsw.com> Date: Fri Jan 31 09:21:12 2025 -0800 libexpr no location Signed-off-by: James Cherry <cherry@parallaxsw.com> commit e3ef17a746eb4e8822cce732250ae77261d53cf9 Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 22:15:50 2025 -0800 compiles Signed-off-by: James Cherry <cherry@parallaxsw.com> commit 3a34874297a5c82930ee0bd131425bccf48526ce Author: James Cherry <cherry@parallaxsw.com> Date: Thu Jan 30 20:03:06 2025 -0800 libexpr parse Signed-off-by: James Cherry <cherry@parallaxsw.com> Signed-off-by: James Cherry <cherry@parallaxsw.com>
2025-02-01 23:49:30 +01:00
SaifScanner::error(const char *msg)
2024-09-24 03:04:26 +02:00
{
report_->fileError(1868, filename_.c_str(), lineno(), "%s", msg);
2024-09-24 03:04:26 +02:00
}
} // namespace