-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[handshake-sim] JSON config for exec models (#11)
This commits adds support for providing a configuration file as well as overrides to choose the set of operation execution models used during an execution of the Handshake simulator. The JSON simply specifies a mapping between operation name and name of the execution model to use for it, while the --change-model command-line flag allows one to enforce the use of specific execution models regardless of the configuration present in the JSON. At this point this is just preparatory work, as the configuration is not used during simulation.
- Loading branch information
Showing
4 changed files
with
170 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"handshake.fork":"defaultFork", | ||
"handshake.merge":"defaultMerge", | ||
"handshake.control_merge":"defaultControlMerge", | ||
"handshake.mux":"defaultMux", | ||
"handshake.br":"defaultBranch", | ||
"handshake.cond_br":"defaultConditionalMerge", | ||
"handshake.sink":"defaultSink", | ||
"handshake.constant":"defaultConstant", | ||
"handshake.buffer":"defaultBuffer", | ||
"handshake.load":"defaultDynamaticLoad", | ||
"handshake.store":"defaultDynamaticStore", | ||
"handshake.return":"defaultDynamaticReturn", | ||
"handshake.end":"defaultEnd", | ||
"handshake.memory_controller":"defaultMemoryController" | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
experimental/include/experimental/tools/handshake-simulator/Simulation.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//===- Simulation.h - Handshake MLIR Operations ---------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file contains functions used to execute a restricted form of the | ||
// standard dialect, and the handshake dialect. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef CIRCT_DIALECT_HANDSHAKE_SIMULATION_H | ||
#define CIRCT_DIALECT_HANDSHAKE_SIMULATION_H | ||
|
||
#include "circt/Support/JSON.h" | ||
#include "mlir/IR/BuiltinOps.h" | ||
#include "mlir/IR/MLIRContext.h" | ||
#include "llvm/ADT/StringMap.h" | ||
#include <string> | ||
|
||
namespace dynamatic { | ||
namespace experimental { | ||
|
||
bool simulate(llvm::StringRef toplevelFunction, | ||
llvm::ArrayRef<std::string> inputArgs, | ||
mlir::OwningOpRef<mlir::ModuleOp> &module, | ||
mlir::MLIRContext &context, | ||
llvm::StringMap<std::string> &config); | ||
} // namespace dynamatic | ||
} // namespace experimental | ||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters