Timing reports for stream writers too, reporting file names for reader and writer timing.

This commit is contained in:
Matthias Koefferlein 2020-04-19 10:39:27 +02:00
parent 9a7f0a9c2a
commit d93ef3ff97
9 changed files with 27 additions and 20 deletions

View File

@ -24,6 +24,8 @@
#include "dbReader.h"
#include "dbStream.h"
#include "tlClassRegistry.h"
#include "tlTimer.h"
#include "tlLog.h"
namespace db
{
@ -74,5 +76,21 @@ Reader::~Reader ()
}
}
const db::LayerMap &
Reader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
{
tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading file: ")) + m_stream.source ());
return mp_actual_reader->read (layout, options);
}
const db::LayerMap &
Reader::read (db::Layout &layout)
{
tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading file: ")) + m_stream.source ());
return mp_actual_reader->read (layout);
}
}

View File

@ -125,10 +125,7 @@ public:
* @param layout The layout object to write to
* @param options The LayerMap object
*/
const db::LayerMap &read (db::Layout &layout, const db::LoadLayoutOptions &options)
{
return mp_actual_reader->read (layout, options);
}
const db::LayerMap &read (db::Layout &layout, const db::LoadLayoutOptions &options);
/**
* @brief The basic read method (without mapping)
@ -143,10 +140,7 @@ public:
* @param layout The layout object to write to
* @return The LayerMap object
*/
const db::LayerMap &read (db::Layout &layout)
{
return mp_actual_reader->read (layout);
}
const db::LayerMap &read (db::Layout &layout);
/**
* @brief Returns a format describing the file format found

View File

@ -26,6 +26,8 @@
#include "tlClassRegistry.h"
#include "tlAssert.h"
#include "tlStream.h"
#include "tlTimer.h"
#include "tlLog.h"
namespace db
{
@ -54,6 +56,8 @@ Writer::~Writer ()
void
Writer::write (db::Layout &layout, tl::OutputStream &stream)
{
tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Writing file: ")) + stream.path ());
tl_assert (mp_writer != 0);
mp_writer->write (layout, stream, m_options);
}

View File

@ -818,8 +818,6 @@ CIFReader::read_cell (db::Layout &layout, db::Cell &cell, double sf, int level)
void
CIFReader::do_read (db::Layout &layout)
{
tl::SelfTimer timer (tl::verbosity () >= 21, "File read");
try {
double sf = 0.01 / m_dbu;

View File

@ -379,8 +379,6 @@ DXFReader::open_layer (db::Layout &layout, const std::string &n)
void
DXFReader::do_read (db::Layout &layout, db::cell_index_type top)
{
tl::SelfTimer timer (tl::verbosity () >= 21, "File read");
// create the zero layer - this is not mapped to GDS but can be specified in the layer mapping as
// a layer named "0".
std::pair<bool, unsigned int> ll = layer_map ().logical (zero_layer_name, layout);

View File

@ -233,8 +233,6 @@ eq_y (const GDS2XY &a, const GDS2XY &b)
void
GDS2ReaderBase::do_read (db::Layout &layout)
{
tl::SelfTimer timer (tl::verbosity () >= 21, "File read");
m_cellname = "";
m_libname = "";
m_mapped_cellnames.clear ();

View File

@ -272,7 +272,6 @@ private:
lefdef_options = &default_options;
}
// Take the layer map and the "read all layers" flag from the reader options - hence we override the
db::LEFDEFReaderState state (lefdef_options);
import_map_file_heuristics (m_stream.absolute_path (), state);
@ -282,7 +281,7 @@ private:
if (import_lef) {
tl::SelfTimer timer (tl::verbosity () >= 11, tl::to_string (tr ("Reading LEF file")));
tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading LEF file")));
db::LEFImporter importer;
@ -301,7 +300,7 @@ private:
} else {
tl::SelfTimer timer (tl::verbosity () >= 11, tl::to_string (tr ("Reading DEF file")));
tl::SelfTimer timer (tl::verbosity () >= 21, tl::to_string (tr ("Reading DEF file")));
DEFImporter importer;

View File

@ -111,7 +111,7 @@ MAGReader::read (db::Layout &layout, const db::LoadLayoutOptions &options)
m_tech.clear ();
{
tl::SelfTimer timer (tl::verbosity () >= 21, "Reading MAGIC file tree");
tl::SelfTimer timer (tl::verbosity () >= 11, "Reading MAGIC file tree");
// This is the seed
do_read (layout, top_cell, m_stream);

View File

@ -689,8 +689,6 @@ static const char magic_bytes[] = { "%SEMI-OASIS\015\012" };
void
OASISReader::do_read (db::Layout &layout)
{
tl::SelfTimer timer (tl::verbosity () >= 21, "File read");
unsigned char r;
char *mb;