Deprecate '--make cmake' option (#6540)
This commit is contained in:
parent
222a3655ba
commit
49c51af841
|
|
@ -20,3 +20,9 @@ C++14 compiler support
|
|||
XML output
|
||||
Verilator currently supports XML parser output (enabled with `--xml-only`).
|
||||
Support for `--xml-*` options will be deprecated no sooner than January 2026.
|
||||
|
||||
--make cmake
|
||||
The `--make cmake` options is deprecated and will be removed no sooner than
|
||||
January 2026. Use `--make json` instead. Note that the CMake integration
|
||||
shipping with verialtor (verilator-config.mk) alerady uses `--make json` so
|
||||
no changes are necessary if using taht
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ For --cc/--sc, it creates:
|
|||
|
||||
.. list-table::
|
||||
|
||||
* - *{prefix}*\ .cmake
|
||||
- CMake include script for compiling (from --make cmake)
|
||||
* - *{prefix}*\ .json
|
||||
- JSON build definition compiling (from --make json)
|
||||
* - *{prefix}*\ .mk
|
||||
- Make include file for compiling (from --make gmake)
|
||||
* - *{prefix}*\ _classes.mk
|
||||
|
|
@ -99,8 +99,8 @@ For --hierarchical mode, it creates:
|
|||
- Make dependencies of the top module (from --hierarchical)
|
||||
* - *{prefix}*\ _hier.mk
|
||||
- Make file for hierarchical blocks (from --make gmake)
|
||||
* - *{prefix}*\ __hierCMakeArgs.f
|
||||
- Arguments for hierarchical Verilation (from --make cmake)
|
||||
* - *{prefix}*\ __hierMkJsonArgs.f
|
||||
- Arguments for hierarchical Verilation (from --make json)
|
||||
* - *{prefix}*\ __hierMkArgs.f
|
||||
- Arguments for hierarchical Verilation (from --make gmake)
|
||||
* - *{prefix}*\ __hierParameters.v
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ When using these options:
|
|||
makefiles to generate an archive (.a) containing the objects.
|
||||
|
||||
#. If :vlopt:`--binary` or :vlopt:`--build` is used, it calls :ref:`GNU
|
||||
Make` or :ref:`CMake` to build the model.
|
||||
Make` to build the model.
|
||||
|
||||
Once a model is built, the next step is typically for the user to run it,
|
||||
see :ref:`Simulating`.
|
||||
|
|
|
|||
|
|
@ -768,7 +768,7 @@ hdr
|
|||
hdzhangdoc
|
||||
hh
|
||||
hier
|
||||
hierCMakeArgs
|
||||
hierMkJsonArgs
|
||||
hierMkArgs
|
||||
hierParameters
|
||||
hierVer
|
||||
|
|
|
|||
|
|
@ -102,19 +102,19 @@
|
|||
|
||||
VL_DEFINE_DEBUG_FUNCTIONS;
|
||||
|
||||
static string V3HierCommandArgsFilename(const string& prefix, bool forCMake) {
|
||||
static string V3HierCommandArgsFilename(const string& prefix, bool forMkJson) {
|
||||
return v3Global.opt.makeDir() + "/" + prefix
|
||||
+ (forCMake ? "__hierCMakeArgs.f" : "__hierMkArgs.f");
|
||||
+ (forMkJson ? "__hierMkJsonArgs.f" : "__hierMkArgs.f");
|
||||
}
|
||||
|
||||
static string V3HierParametersFileName(const string& prefix) {
|
||||
return v3Global.opt.makeDir() + "/" + prefix + "__hierParameters.v";
|
||||
}
|
||||
|
||||
static void V3HierWriteCommonInputs(const V3HierBlock* hblockp, std::ostream* of, bool forCMake) {
|
||||
static void V3HierWriteCommonInputs(const V3HierBlock* hblockp, std::ostream* of, bool forMkJson) {
|
||||
string topModuleFile;
|
||||
if (hblockp) topModuleFile = hblockp->vFileIfNecessary();
|
||||
if (!forCMake) {
|
||||
if (!forMkJson) {
|
||||
if (!topModuleFile.empty()) *of << topModuleFile << "\n";
|
||||
for (const auto& i : v3Global.opt.vFiles()) *of << i.filename() << "\n";
|
||||
}
|
||||
|
|
@ -158,10 +158,10 @@ V3HierBlock::StrGParams V3HierBlock::stringifyParams(const V3HierBlockParams::GP
|
|||
return strParams;
|
||||
}
|
||||
|
||||
VStringList V3HierBlock::commandArgs(bool forCMake) const {
|
||||
VStringList V3HierBlock::commandArgs(bool forMkJson) const {
|
||||
VStringList opts;
|
||||
const string prefix = hierPrefix();
|
||||
if (!forCMake) {
|
||||
if (!forMkJson) {
|
||||
opts.push_back(" --prefix " + prefix);
|
||||
opts.push_back(" --mod-prefix " + prefix);
|
||||
opts.push_back(" --top-module " + modp()->name());
|
||||
|
|
@ -249,17 +249,17 @@ string V3HierBlock::vFileIfNecessary() const {
|
|||
return filename;
|
||||
}
|
||||
|
||||
void V3HierBlock::writeCommandArgsFile(bool forCMake) const {
|
||||
const std::unique_ptr<std::ofstream> of{V3File::new_ofstream(commandArgsFilename(forCMake))};
|
||||
void V3HierBlock::writeCommandArgsFile(bool forMkJson) const {
|
||||
const std::unique_ptr<std::ofstream> of{V3File::new_ofstream(commandArgsFilename(forMkJson))};
|
||||
*of << "--cc\n";
|
||||
|
||||
if (!forCMake) {
|
||||
if (!forMkJson) {
|
||||
for (const V3HierBlock* const hierblockp : m_children) {
|
||||
*of << v3Global.opt.makeDir() << "/" << hierblockp->hierWrapperFilename(true) << "\n";
|
||||
}
|
||||
*of << "-Mdir " << v3Global.opt.makeDir() << "/" << hierPrefix() << " \n";
|
||||
}
|
||||
V3HierWriteCommonInputs(this, of.get(), forCMake);
|
||||
V3HierWriteCommonInputs(this, of.get(), forMkJson);
|
||||
const VStringList& commandOpts = commandArgs(false);
|
||||
for (const string& opt : commandOpts) *of << opt << "\n";
|
||||
*of << hierBlockArgs().front() << "\n";
|
||||
|
|
@ -269,8 +269,8 @@ void V3HierBlock::writeCommandArgsFile(bool forCMake) const {
|
|||
*of << v3Global.opt.allArgsStringForHierBlock(false) << "\n";
|
||||
}
|
||||
|
||||
string V3HierBlock::commandArgsFilename(bool forCMake) const {
|
||||
return V3HierCommandArgsFilename(hierPrefix(), forCMake);
|
||||
string V3HierBlock::commandArgsFilename(bool forMkJson) const {
|
||||
return V3HierCommandArgsFilename(hierPrefix(), forMkJson);
|
||||
}
|
||||
|
||||
string V3HierBlock::typeParametersFilename() const {
|
||||
|
|
@ -456,21 +456,21 @@ V3HierBlockPlan::HierVector V3HierBlockPlan::hierBlocksSorted() const {
|
|||
return sorted;
|
||||
}
|
||||
|
||||
void V3HierBlockPlan::writeCommandArgsFiles(bool forCMake) const {
|
||||
void V3HierBlockPlan::writeCommandArgsFiles(bool forMkJson) const {
|
||||
for (const_iterator it = begin(); it != end(); ++it) {
|
||||
it->second.writeCommandArgsFile(forCMake);
|
||||
it->second.writeCommandArgsFile(forMkJson);
|
||||
}
|
||||
// For the top module
|
||||
const std::unique_ptr<std::ofstream> of{
|
||||
V3File::new_ofstream(topCommandArgsFilename(forCMake))};
|
||||
if (!forCMake) {
|
||||
V3File::new_ofstream(topCommandArgsFilename(forMkJson))};
|
||||
if (!forMkJson) {
|
||||
// Load wrappers first not to be overwritten by the original HDL
|
||||
for (const_iterator it = begin(); it != end(); ++it) {
|
||||
*of << it->second.hierWrapperFilename(true) << "\n";
|
||||
}
|
||||
}
|
||||
V3HierWriteCommonInputs(nullptr, of.get(), forCMake);
|
||||
if (!forCMake) {
|
||||
V3HierWriteCommonInputs(nullptr, of.get(), forMkJson);
|
||||
if (!forMkJson) {
|
||||
const VStringSet& cppFiles = v3Global.opt.cppFiles();
|
||||
for (const string& i : cppFiles) *of << i << "\n";
|
||||
*of << "--top-module " << v3Global.rootp()->topModulep()->name() << "\n";
|
||||
|
|
@ -493,8 +493,8 @@ void V3HierBlockPlan::writeCommandArgsFiles(bool forCMake) const {
|
|||
*of << v3Global.opt.allArgsStringForHierBlock(true) << "\n";
|
||||
}
|
||||
|
||||
string V3HierBlockPlan::topCommandArgsFilename(bool forCMake) {
|
||||
return V3HierCommandArgsFilename(v3Global.opt.prefix(), forCMake);
|
||||
string V3HierBlockPlan::topCommandArgsFilename(bool forMkJson) {
|
||||
return V3HierCommandArgsFilename(v3Global.opt.prefix(), forMkJson);
|
||||
}
|
||||
|
||||
void V3HierBlockPlan::writeParametersFiles() const {
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ public:
|
|||
const V3HierBlockParams& params() const { return m_params; }
|
||||
const AstNodeModule* modp() const { return m_modp; }
|
||||
|
||||
// For emitting Makefile and CMakeLists.txt
|
||||
VStringList commandArgs(bool forCMake) const VL_MT_DISABLED;
|
||||
// For emitting Makefile and build definition JSON
|
||||
VStringList commandArgs(bool forMkJson) const VL_MT_DISABLED;
|
||||
VStringList hierBlockArgs() const VL_MT_DISABLED;
|
||||
string hierPrefix() const VL_MT_DISABLED;
|
||||
string hierSomeFilename(bool withDir, const char* prefix,
|
||||
|
|
@ -112,9 +112,9 @@ public:
|
|||
// Returns the original HDL file if it is not included in v3Global.opt.vFiles().
|
||||
string vFileIfNecessary() const VL_MT_DISABLED;
|
||||
// Write command line arguments to .f file for this hierarchical block
|
||||
void writeCommandArgsFile(bool forCMake) const VL_MT_DISABLED;
|
||||
void writeCommandArgsFile(bool forMkJson) const VL_MT_DISABLED;
|
||||
void writeParametersFile() const VL_MT_DISABLED;
|
||||
string commandArgsFilename(bool forCMake) const VL_MT_DISABLED;
|
||||
string commandArgsFilename(bool forMkJson) const VL_MT_DISABLED;
|
||||
string typeParametersFilename() const VL_MT_DISABLED;
|
||||
};
|
||||
|
||||
|
|
@ -146,9 +146,9 @@ public:
|
|||
HierVector hierBlocksSorted() const VL_MT_DISABLED;
|
||||
|
||||
// Write command line arguments to .f files for child Verilation run
|
||||
void writeCommandArgsFiles(bool forCMake) const VL_MT_DISABLED;
|
||||
void writeCommandArgsFiles(bool forMkJson) const VL_MT_DISABLED;
|
||||
void writeParametersFiles() const VL_MT_DISABLED;
|
||||
static string topCommandArgsFilename(bool forCMake) VL_MT_DISABLED;
|
||||
static string topCommandArgsFilename(bool forMkJson) VL_MT_DISABLED;
|
||||
|
||||
static void createPlan(AstNetlist* nodep) VL_MT_DISABLED;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1520,6 +1520,8 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
|
|||
DECL_OPTION("-make", CbVal, [this, fl](const char* valp) {
|
||||
if (!std::strcmp(valp, "cmake")) {
|
||||
m_cmake = true;
|
||||
fl->v3warn(DEPRECATED,
|
||||
"Option '--make cmake' is deprecated, use '--make json' instead");
|
||||
} else if (!std::strcmp(valp, "gmake")) {
|
||||
m_gmake = true;
|
||||
} else if (!std::strcmp(valp, "json")) {
|
||||
|
|
|
|||
|
|
@ -819,6 +819,7 @@ static void execBuildJob() {
|
|||
UASSERT(v3Global.opt.build(), "--build is not specified.");
|
||||
UASSERT(v3Global.opt.gmake(), "--build requires GNU Make.");
|
||||
UASSERT(!v3Global.opt.cmake(), "--build cannot use CMake.");
|
||||
UASSERT(!v3Global.opt.makeJson(), "--build cannot use json build.");
|
||||
VlOs::DeltaWallTime buildWallTime{true};
|
||||
UINFO(1, "Start Build");
|
||||
|
||||
|
|
|
|||
|
|
@ -1077,10 +1077,6 @@ class VlTest:
|
|||
verilator_flags += ["--threads", str(param['threads'])]
|
||||
if param['vltmt'] and re.search(r'-trace-fst ', checkflags):
|
||||
verilator_flags += ["--trace-threads 2"]
|
||||
if param['verilator_make_cmake']:
|
||||
verilator_flags += ["--make cmake"]
|
||||
if param['verilator_make_gmake']:
|
||||
verilator_flags += ["--make gmake"]
|
||||
if param['make_main'] and param['verilator_make_gmake']:
|
||||
verilator_flags += ["--exe"]
|
||||
if param['make_main'] and param['verilator_make_gmake']:
|
||||
|
|
|
|||
|
|
@ -15,7 +15,11 @@ test.compile(verilator_flags2=["--build --make gmake"],
|
|||
fails=True,
|
||||
expect_filename=test.golden_filename)
|
||||
|
||||
test.compile(verilator_flags2=["--build --make cmake"],
|
||||
test.compile(verilator_flags2=["--build --make cmake -Wno-fatal"],
|
||||
fails=True,
|
||||
expect_filename="t/t_flag_build_bad_cmake.out")
|
||||
|
||||
test.compile(verilator_flags2=["--build --make json"],
|
||||
fails=True,
|
||||
expect_filename=test.golden_filename)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
%Warning-DEPRECATED: Option '--make cmake' is deprecated, use '--make json' instead
|
||||
... For warning description see https://verilator.org/warn/DEPRECATED?v=latest
|
||||
... Use "/* verilator lint_off DEPRECATED */" and lint_on around source to disable this message.
|
||||
%Error: --make cannot be used together with --build. Suggest see manual
|
||||
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
|
||||
%Error: Exiting due to
|
||||
|
|
@ -13,9 +13,6 @@ test.scenarios('simulator')
|
|||
|
||||
test.compile(verilator_make_gmake=False, verilator_make_cmake=True)
|
||||
|
||||
if not test.have_cmake:
|
||||
test.skip("cmake is not installed")
|
||||
|
||||
cmakecache = test.obj_dir + "/CMakeCache.txt"
|
||||
if not os.path.exists(cmakecache):
|
||||
test.error(cmakecache + " does not exist")
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import vltest_bootstrap
|
|||
test.scenarios('simulator')
|
||||
test.top_filename = "t/t_probdist.v"
|
||||
|
||||
test.compile(verilator_make_gmake=False, verilator_make_cmake=1)
|
||||
test.compile(verilator_make_gmake=False, verilator_make_cmake=True)
|
||||
|
||||
test.execute()
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ test.top_filename = "t/t_timing_events.v"
|
|||
|
||||
if not test.have_coroutines:
|
||||
test.skip("No coroutine support")
|
||||
if not test.have_cmake:
|
||||
test.skip("cmake is not installed")
|
||||
|
||||
if re.search(r'clang', test.cxx_version):
|
||||
test.skip("Known clang bug on ubuntu-24.04")
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import vltest_bootstrap
|
|||
|
||||
test.scenarios('vlt_all')
|
||||
|
||||
test.compile(v_flags2=["--trace-fst"], verilator_make_gmake=False, verilator_make_cmake=1)
|
||||
test.compile(v_flags2=["--trace-fst"], verilator_make_gmake=False, verilator_make_cmake=True)
|
||||
|
||||
test.execute()
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ if not test.have_sc:
|
|||
|
||||
test.compile(verilator_flags2=["--trace-fst --sc"],
|
||||
verilator_make_gmake=False,
|
||||
verilator_make_cmake=1)
|
||||
verilator_make_cmake=True)
|
||||
|
||||
test.execute()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue