2 * yosys -- Yosys Open SYnthesis Suite
4 * Copyright (C) 2022 Miodrag Milanovic <micko@yosyshq.com>
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #include "kernel/yosys.h"
24 #include "libs/fst/fstapi.h"
40 FstData(std::string filename
);
43 uint64_t getStartTime();
44 uint64_t getEndTime();
46 std::vector
<FstVar
>& getVars() { return vars
; };
48 void reconstruct_edges_callback(uint64_t pnt_time
, fstHandle pnt_facidx
, const unsigned char *pnt_value
, uint32_t plen
);
49 std::vector
<uint64_t> getAllEdges(std::vector
<fstHandle
> &signal
, uint64_t start_time
, uint64_t end_time
);
51 void reconstruct_callback_attimes(uint64_t pnt_time
, fstHandle pnt_facidx
, const unsigned char *pnt_value
, uint32_t plen
);
52 void reconstructAtTimes(std::vector
<fstHandle
> &signal
,std::vector
<uint64_t> time
);
53 void reconstructAllAtTimes(std::vector
<uint64_t> time
);
55 std::string
valueAt(fstHandle signal
, uint64_t time
);
56 fstHandle
getHandle(std::string name
);
57 double getTimescale() { return timescale
; }
59 void extractVarNames();
61 struct fstReaderContext
*ctx
;
62 std::vector
<std::string
> scopes
;
63 std::vector
<FstVar
> vars
;
64 std::map
<fstHandle
, FstVar
> handle_to_var
;
65 std::map
<std::string
, fstHandle
> name_to_handle
;
66 std::map
<fstHandle
, std::vector
<std::pair
<uint64_t, std::string
>>> handle_to_data
;
67 std::map
<fstHandle
, std::string
> last_data
;
68 std::map
<fstHandle
, std::map
<uint64_t, size_t>> time_to_index
;
69 std::vector
<uint64_t> sample_times
;
70 size_t sample_times_ndx
;
74 std::vector
<uint64_t> edges
;