Download chips/yosys/kernel/fstdata.h from STAR-future/Trinity-SciData: direct link, hf CLI and curl.
- Browser
- Download file 2.56 kB
-
https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/kernel/fstdata.h
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SciData/chips/yosys/kernel/fstdata.h
-
curl -L -o fstdata.h https://huggingface.co/datasets/STAR-future/Trinity-SciData/resolve/main/chips/yosys/kernel/fstdata.h
2.56 kB
| /* | |
| * yosys -- Yosys Open SYnthesis Suite | |
| * | |
| * Copyright (C) 2022 Miodrag Milanovic <micko@yosyshq.com> | |
| * | |
| * Permission to use, copy, modify, and/or distribute this software for any | |
| * purpose with or without fee is hereby granted, provided that the above | |
| * copyright notice and this permission notice appear in all copies. | |
| * | |
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
| * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
| * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
| * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
| * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
| * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
| * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
| * | |
| */ | |
| 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; | |
| }; | |
| class FstData | |
| { | |
| public: | |
| FstData(std::string filename); | |
| ~FstData(); | |
| uint64_t getStartTime(); | |
| uint64_t getEndTime(); | |
| std::vector<FstVar>& getVars() { return vars; }; | |
| void reconstruct_callback_attimes(uint64_t pnt_time, fstHandle pnt_facidx, const unsigned char *pnt_value, uint32_t plen); | |
| void reconstructAllAtTimes(std::vector<fstHandle> &signal, uint64_t start_time, uint64_t end_time, unsigned int end_cycle, CallbackFunction cb); | |
| std::string valueOf(fstHandle signal); | |
| fstHandle getHandle(std::string name); | |
| dict<int,fstHandle> getMemoryHandles(std::string name); | |
| int getScale() { return scale; } | |
| const char *getTimescaleString() { return timescale_str.c_str(); } | |
| private: | |
| void extractVarNames(); | |
| struct fstReaderContext *ctx; | |
| std::vector<FstVar> vars; | |
| std::map<fstHandle, FstVar> handle_to_var; | |
| std::map<std::string, fstHandle> name_to_handle; | |
| std::map<std::string, dict<int, fstHandle>> memory_to_handle; | |
| std::map<fstHandle, std::string> last_data; | |
| uint64_t last_time; | |
| std::map<fstHandle, std::string> past_data; | |
| uint64_t past_time; | |
| int scale; // exponent of 10, e.g. -6 = us, -9 = ns | |
| std::string timescale_str; | |
| uint64_t start_time; | |
| uint64_t end_time; | |
| unsigned int last_cycle; | |
| unsigned int curr_cycle; | |
| CallbackFunction callback; | |
| std::vector<fstHandle> clk_signals; | |
| bool all_samples; | |
| std::string tmp_file; | |
| }; | |
| YOSYS_NAMESPACE_END | |