Skip to content

Commit

Permalink
Final changes made for the draft PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidtahirbutt committed Aug 31, 2023
1 parent 0ac7791 commit c0a4f23
Show file tree
Hide file tree
Showing 13 changed files with 405 additions and 251 deletions.
348 changes: 158 additions & 190 deletions src/DesignQuery/DesignQuery.cpp

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
/**
* @file main_sdtgen_cpp_nlohman_lib_v5.cpp
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team
//**********************************************************************************************************************************
// JSON to SDT cpp script written by ZaidTahir, for questions please email:
// [email protected] or [email protected] **************
// *********************************************************************************************************************************
* GPL License
* Copyright (c) 2021 The Open-Source FPGA Foundation
* 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 <http://www.gnu.org/licenses/>.
*/

#include <cstdio>

Expand Down Expand Up @@ -111,9 +131,26 @@ int main(int, char*[]) {

outfile << "/*\n \
*\n \
*Copyright (c) 2023 Rapid Silicon\n \
*SPDX-License-Identifier: rs-eula\n \
*JSON to SDT cpp script written by ZaidTahir, for questions please email: [email protected] or [email protected]\n*/\n\n";
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)\n \
* @date 2023-08-30\n \
* @copyright Copyright 2021 The Foedag team\n \
\n \
* GPL License\n \
\n \
* Copyright (c) 2021 The Open-Source FPGA Foundation\n \
\n \
* This program is free software: you can redistribute it and/or modify\n \
* it under the terms of the GNU General Public License as published by\n \
* the Free Software Foundation, either version 3 of the License, or\n \
* (at your option) any later version.\n \
\n \
* This program is distributed in the hope that it will be useful,\n \
* but WITHOUT ANY WARRANTY; without even the implied warranty of\n \
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n \
* GNU General Public License for more details.\n \
\n \
* You should have received a copy of the GNU General Public License\n \
* along with this program. If not, see <http://www.gnu.org/licenses/>. \n*/\n\n";

outfile << "/dts-v1/;\n\n"
<< "/ {\n";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
/*
*
*Copyright (c) 2023 Rapid Silicon
*SPDX-License-Identifier: rs-eula
*JSON to SDT cpp script written by ZaidTahir, for questions please email: [email protected] or [email protected]
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team

* GPL License

* Copyright (c) 2021 The Open-Source FPGA Foundation

* 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 <http://www.gnu.org/licenses/>.
*/

/dts-v1/;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
/**
* @file sdtgen_cpp_nlohman_lib_v5.cpp
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team
* GPL License
* Copyright (c) 2021 The Open-Source FPGA Foundation
* 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 <http://www.gnu.org/licenses/>.
*/

//**********************************************************************************************************************************
// JSON to SDT cpp script written by ZaidTahir, for questions please email:
// [email protected] or [email protected] **************
// *********************************************************************************************************************************
#include "sdtgen_cpp_nlohman_lib_v5.h"

#include <cstdio>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@

//**********************************************************************************************************************************
// JSON to SDT cpp script written by ZaidTahir, for questions please email:
// [email protected] or [email protected] **************
// *********************************************************************************************************************************
/**
* @file sdtgen_cpp_nlohman_lib_v5.h
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team
* GPL License
* Copyright (c) 2021 The Open-Source FPGA Foundation
* 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 <http://www.gnu.org/licenses/>.
*/

#ifndef MY_CLASS_H // include guard
#define MY_CLASS_H
Expand Down
26 changes: 22 additions & 4 deletions src/DesignQuery/scripts/tcl_script_for_sdt_generation/output.sdt
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
/*
*Copyright (c) 2023 Rapid Silicon
*SPDX-License-Identifier: rs-eula
*JSON to SDT TCL script written by ZaidTahir, for questions please email: [email protected] or [email protected]
*/
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team

* GPL License

* Copyright (c) 2021 The Open-Source FPGA Foundation

* 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 <http://www.gnu.org/licenses/>.

*/


/dts-v1/;
Expand Down
55 changes: 47 additions & 8 deletions src/DesignQuery/scripts/tcl_script_for_sdt_generation/sdtgen.tcl
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# /**

# * @file main_sdtgen_cpp_nlohman_lib_v5.cpp
# * @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
# * @date 2023-08-30
# * @copyright Copyright 2021 The Foedag team

# * GPL License

# * Copyright (c) 2021 The Open-Source FPGA Foundation

# * 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 <http://www.gnu.org/licenses/>.

# */

#!/usr/bin/tclsh
package require json
package require Tcl 8.5
Expand All @@ -9,10 +35,6 @@ if {$::tcl_version < 8.5} {
package require dict
}

##########################################################################################################################################
########## JSON to SDT TCL script written by ZaidTahir, for questions please email: [email protected] or [email protected] ############
##########################################################################################################################################

# Use this command to run this script:
# "tclsh sdtgen_v6.tcl -o output_v6.sdt -f"
# All functionality moved to procs in tcl script version5
Expand Down Expand Up @@ -416,10 +438,27 @@ proc get_board_info {} {

proc gen_copyright_header {} {
set copyrightString "/*\n \
*Copyright (c) 2023 Rapid Silicon\n \
*SPDX-License-Identifier: rs-eula\n \
*JSON to SDT TCL script written by ZaidTahir, for questions please email: [email protected] or [email protected]\n \
*/\n\n"
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)\n \
* @date 2023-08-30\n \
* @copyright Copyright 2021 The Foedag team\n \
\n \
* GPL License\n \
\n \
* Copyright (c) 2021 The Open-Source FPGA Foundation\n \
\n \
* This program is free software: you can redistribute it and/or modify\n \
* it under the terms of the GNU General Public License as published by\n \
* the Free Software Foundation, either version 3 of the License, or\n \
* (at your option) any later version.\n \
\n \
* This program is distributed in the hope that it will be useful,\n \
* but WITHOUT ANY WARRANTY; without even the implied warranty of\n \
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n \
* GNU General Public License for more details.\n \
\n \
* You should have received a copy of the GNU General Public License\n \
* along with this program. If not, see <http://www.gnu.org/licenses/>. \n\
\n*/\n\n"

return $copyrightString
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
/**
* @file sdtgen.cpp
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team
//**********************************************************************************************************************************
// JSON to SDT cpp script written by ZaidTahir, for questions please email:
// [email protected] or [email protected] **************
// *********************************************************************************************************************************
* GPL License
* Copyright (c) 2021 The Open-Source FPGA Foundation
* 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 <http://www.gnu.org/licenses/>.
*/

#include <cstdio>
// #include <nlohmann_json/json.hpp>

#include "nlohmann_json/json.hpp"
// #include "json.hpp"
// #include "json/single_include/nlohmann/json.hpp"
// #include <json/single_include/nlohmann/json_fwd.hpp>

#include "sdtgen_cpp_nlohman_lib_v6.h"
#include "sdtgen.h"

using namespace std;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,35 @@
/**
* @file sdtgen.h
* @author Zaid Tahir ([email protected] or [email protected] or https://github.com/zaidtahirbutt)
* @date 2023-08-30
* @copyright Copyright 2021 The Foedag team
//**********************************************************************************************************************************
// JSON to SDT cpp script written by ZaidTahir, for questions please email:
// [email protected] or [email protected] **************
// *********************************************************************************************************************************
* GPL License
* Copyright (c) 2021 The Open-Source FPGA Foundation
* 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 <http://www.gnu.org/licenses/>.
*/

#ifndef MY_CLASS_H // include guard
#define MY_CLASS_H

#include <cstdio>
// #include <nlohmann_json/json.hpp>
#include "nlohmann_json/json.hpp"
// #include "json.hpp"
// #include "json/single_include/nlohmann/json.hpp"
// #include <json/single_include/nlohmann/json_fwd.hpp>

// using json = nlohmann::json;
#include "nlohmann_json/json.hpp"

using namespace std;

Expand Down
12 changes: 7 additions & 5 deletions tests/Testcases/DesignQuery/gbox_top.tcl
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# puts [ test_device_modeling_tcl ]
# puts [ exec date ]
# puts [ get_file_ids ] # works now after adding additional code


# use "verbose" with tcl command to display debugging information for the sdt generating cpp library "sdtgen_cpp_nlohman_lib_v6"

# puts [ sdt_gen_cpus_node verbose ]
# # puts [ sdt_gen_cpus_node verbose ]
puts [ sdt_gen_cpus_node ]
# # puts [ sdt_gen_cpus_cluster_node verbose ]
# puts [ sdt_gen_cpus_cluster_node verbose ]
puts [ sdt_gen_cpus_cluster_node ]
# # puts [ sdt_gen_memory_node verbose ]
# puts [ sdt_gen_memory_node verbose ]
puts [ sdt_gen_memory_node ]
# # puts [ sdt_gen_soc_node verbose ]
# puts [ sdt_gen_soc_node verbose ]
puts [ sdt_gen_soc_node ]
# # puts [ sdt_gen_root_metadata_node verbose ]
# # # puts [ sdt_gen_root_metadata_node verbose ]
puts [ sdt_gen_root_metadata_node ]
# puts [ sdt_gen_system_device_tree verbose ]
puts [ sdt_gen_system_device_tree ]
Expand Down
10 changes: 5 additions & 5 deletions tests/Testcases/DesignQuery/test_parse_design_data.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ set_top_module top
synth

# Test get_file_ids and error out if the correct file ids weren't captured from the dummy data in hier_info.json
# set ids [get_file_ids]
# if { ![string compare $ids "1 10 11 12 2 3 4 5 6 7 8 9"] } {
# puts "TEST FAILED: get_file_ids should have generated 1 10 11 12 2 3 4 5 6 7 8 9"
# exit 1
# }
set ids [get_file_ids]
if { ![string compare $ids "1 10 11 12 2 3 4 5 6 7 8 9"] } {
puts "TEST FAILED: get_file_ids should have generated 1 10 11 12 2 3 4 5 6 7 8 9"
exit 1
}

exit 0
2 changes: 1 addition & 1 deletion third_party/gtkwave
Submodule gtkwave updated 80 files
+0 −2 CHANGELOG.md
+3 −0 examples/gtkwaverc
+6 −0 man/gtkwaverc.5
+0 −1 meson.build
+11 −0 share/icons/Makefile.am
+3 −0 share/icons/gnome/16x16/Makefile.am
+20 −0 share/icons/gnome/16x16/mimetypes/Makefile.am
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-ae2.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-aet.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-evcd.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-fst.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-ghw.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-gtkw.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-lx2.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-lxt.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-lxt2.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-vcd.png
+ share/icons/gnome/16x16/mimetypes/gnome-mime-application-vnd.gtkwave-vzt.png
+ share/icons/gnome/16x16/mimetypes/gtkwave.png
+3 −0 share/icons/gnome/32x32/Makefile.am
+20 −0 share/icons/gnome/32x32/mimetypes/Makefile.am
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-ae2.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-aet.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-evcd.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-fst.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-ghw.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-gtkw.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-lx2.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-lxt.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-lxt2.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-vcd.png
+ share/icons/gnome/32x32/mimetypes/gnome-mime-application-vnd.gtkwave-vzt.png
+ share/icons/gnome/32x32/mimetypes/gtkwave.png
+3 −0 share/icons/gnome/48x48/Makefile.am
+20 −0 share/icons/gnome/48x48/mimetypes/Makefile.am
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-ae2.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-aet.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-evcd.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-fst.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-ghw.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-gtkw.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-lx2.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-lxt.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-lxt2.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-vcd.png
+ share/icons/gnome/48x48/mimetypes/gnome-mime-application-vnd.gtkwave-vzt.png
+ share/icons/gnome/48x48/mimetypes/gtkwave.png
+3 −0 share/icons/gnome/Makefile.am
+ share/icons/gtkwave_256x256x32.png
+ share/icons/gtkwave_files_256x256x32.png
+ share/icons/gtkwave_savefiles_256x256x32.png
+3 −0 share/icons/hicolor/Makefile.am
+3 −0 share/icons/hicolor/scalable/Makefile.am
+10 −0 share/icons/hicolor/scalable/apps/Makefile.am
+246 −0 share/icons/hicolor/scalable/apps/gtkwave.svg
+0 −106 share/icons/io.github.gtkwave.GTKWave-symbolic.svg
+0 −245 share/icons/io.github.gtkwave.GTKWave.Devel.svg
+0 −112 share/icons/io.github.gtkwave.GTKWave.svg
+33 −6 share/icons/meson.build
+33 −1 src/ae2.c
+23 −0 src/analyzer.c
+87 −24 src/bitvec.c
+41 −2 src/extload.c
+100 −17 src/fst.c
+25 −0 src/ghw.c
+5 −0 src/globals.c
+3 −0 src/globals.h
+134 −59 src/lx2.c
+24 −0 src/lxt.c
+11 −0 src/main.c
+16 −0 src/rc.c
+2 −0 src/rc.h
+77 −0 src/search.c
+2 −0 src/symbol.c
+1 −0 src/symbol.h
+118 −19 src/vcd.c
+3 −0 src/vcd.h
+27 −12 src/vcd_partial.c
+17 −3 src/vcd_recoder.c
+136 −60 src/vzt.c

0 comments on commit c0a4f23

Please sign in to comment.