Bump version
[yosys.git] / kernel / fstdata.h
index e7595cbf6f226c858749ed8bf81471339b7e6bad..0e9d27e2ca385ec7f3b3b383e1dcae5878ea2d48 100644 (file)
 
 YOSYS_NAMESPACE_BEGIN
 
+typedef std::function<void(uint64_t)> CallbackFunction;
+struct fst_end_of_data_exception { };
+
 struct FstVar
 {
        fstHandle id;
        std::string name;
        bool is_alias;
+       bool is_reg;
        std::string scope;
        int width;
 };
@@ -45,19 +49,13 @@ class FstData
 
        std::vector<FstVar>& getVars() { return vars; };
 
-       void reconstruct_callback(uint64_t pnt_time, fstHandle pnt_facidx, const unsigned char *pnt_value, uint32_t plen);
-       void reconstruct(std::vector<fstHandle> &signal);
-       void reconstuctAll();
-
        void reconstruct_callback_attimes(uint64_t pnt_time, fstHandle pnt_facidx, const unsigned char *pnt_value, uint32_t plen);
-       void reconstructAtTimes(std::vector<fstHandle> &signal,std::vector<uint64_t> time);
-       void reconstructAllAtTimes(std::vector<uint64_t> time);
-
-       std::string valueAt(fstHandle signal, uint64_t time);
-       std::vector<uint64_t> edges(fstHandle signal, bool positive, bool negative);
-       void recalc_time_offsets(fstHandle signal, std::vector<uint64_t> time);
+       void reconstructAllAtTimes(std::vector<fstHandle> &signal, uint64_t start_time, uint64_t end_time, CallbackFunction cb);
 
+       std::string valueOf(fstHandle signal);
        fstHandle getHandle(std::string name);
+       double getTimescale() { return timescale; }
+       const char *getTimescaleString() { return timescale_str.c_str(); }
 private:
        void extractVarNames();
 
@@ -66,12 +64,18 @@ private:
        std::vector<FstVar> vars;
        std::map<fstHandle, FstVar> handle_to_var;
        std::map<std::string, fstHandle> name_to_handle;
-       std::map<fstHandle, std::vector<std::pair<uint64_t, std::string>>> handle_to_data;
-       std::map<fstHandle, std::map<uint64_t, size_t>> time_to_index;
-       std::map<fstHandle, std::map<size_t, uint64_t>> index_to_time;
-       std::vector<uint64_t> sample_times;
-       size_t sample_times_ndx;
-       std::map<fstHandle, std::string> current;
+       std::map<fstHandle, std::string> last_data;
+       uint64_t last_time;
+       std::map<fstHandle, std::string> past_data;
+       uint64_t past_time;
+       double timescale;
+       std::string timescale_str;
+       uint64_t start_time;
+       uint64_t end_time;
+       CallbackFunction callback;
+       std::vector<fstHandle> clk_signals;
+       bool all_samples;
+       std::string tmp_file;
 };
 
 YOSYS_NAMESPACE_END