-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add xdma demo #1
Open
ruiqurm
wants to merge
32
commits into
datenlord:master
Choose a base branch
from
ruiqurm:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 17 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
184d1e8
temporarily change the url of libsystemctlm-soc
ruiqurm e26e3d0
provide a docker file to build container.
ruiqurm facb894
a simple xdma-demo that connect XDMA with qemu
ruiqurm 89e501c
add a descriptor bypass and TLM bridge.
ruiqurm 673139c
connect user logic and XDMA
ruiqurm 0e66b8c
update libsystemctlm-soc submodule
ruiqurm 3897225
add user logic example
ruiqurm 7e57849
Configurations for formating
ruiqurm 4b6f851
update Makefile
ruiqurm b969979
connect to userlogic and formating
ruiqurm d47209f
script to generate multiple channels
ruiqurm 7ebb5c5
update Makefile
ruiqurm 8f9bc7d
update module
ruiqurm 0b5fb04
replace constant value and update script
ruiqurm 1e94b13
fix some linter warnings
ruiqurm 0ee53ac
remove redundant comments according to review
ruiqurm e50fc47
remove comments and convert Chinese comment
ruiqurm b2634f6
Fix makefile bug that can not run on parallel.
ruiqurm 6ccf4db
Fix makefile bug that can not run on parallel.
ruiqurm 38582b9
format xdma-demo.cc
ruiqurm e50bea1
add new user logic
ruiqurm ccab0e2
add a slow clock/reset according to new user logic
ruiqurm 54fa335
use dynamic linking
ruiqurm 488797d
Merge remote-tracking branch 'origin'
ruiqurm d0e323a
add python wrapper
ruiqurm 130f4cd
update README.md
ruiqurm 9a33861
python binding demo
ruiqurm 1ac0aa7
move `xdma_cosim.cc` to new path
ruiqurm 43d8b35
separate `distrosim` from previous `xdma` module
ruiqurm 39f3986
New abstract for generic_initiator and generic_target. There's also a…
ruiqurm 555565b
add comments
ruiqurm 69c2e53
add comments
ruiqurm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,80 @@ | ||
# Google C/C++ Code Style settings | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
AccessModifierOffset: -1 | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveAssignments: None | ||
AlignOperands: Align | ||
AllowAllArgumentsOnNextLine: true | ||
AllowAllConstructorInitializersOnNextLine: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Empty | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortIfStatementsOnASingleLine: Never # To avoid conflict, set this "Never" and each "if statement" should include brace when coding | ||
AllowShortLambdasOnASingleLine: Inline | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakTemplateDeclarations: Yes | ||
BinPackArguments: true | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: false | ||
AfterStruct: false | ||
AfterControlStatement: Never | ||
AfterEnum: false | ||
AfterFunction: false | ||
AfterNamespace: false | ||
AfterUnion: false | ||
AfterExternBlock: false | ||
BeforeCatch: false | ||
BeforeElse: false | ||
BeforeLambdaBody: false | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
BreakBeforeBinaryOperators: None | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: BeforeColon | ||
BreakInheritanceList: BeforeColon | ||
ColumnLimit: 80 | ||
CompactNamespaces: false | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: true | ||
DerivePointerAlignment: false # Make sure the * or & align on the left | ||
EmptyLineBeforeAccessModifier: LogicalBlock | ||
FixNamespaceComments: true | ||
IncludeBlocks: Preserve | ||
IndentCaseLabels: true | ||
IndentPPDirectives: None | ||
IndentWidth: 2 | ||
KeepEmptyLinesAtTheStartOfBlocks: true | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCSpaceAfterProperty: false | ||
ObjCSpaceBeforeProtocolList: true | ||
PointerAlignment: Left | ||
ReflowComments: false | ||
# SeparateDefinitionBlocks: Always # Only support since clang-format 14 | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCpp11BracedList: false | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeInheritanceColon: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceBeforeSquareBrackets: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 2 | ||
SpacesInAngles: false | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInContainerLiterals: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
Standard: c++11 | ||
TabWidth: 4 | ||
UseTab: Never |
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,126 @@ | ||
--- | ||
# Configure clang-tidy for this project. | ||
|
||
# Here is an explanation for why some of the checks are disabled: | ||
# | ||
# -google-readability-namespace-comments: the *_CLIENT_NS is a macro, and | ||
# clang-tidy fails to match it against the initial value. | ||
# | ||
# -modernize-use-trailing-return-type: clang-tidy recommends using | ||
# `auto Foo() -> std::string { return ...; }`, we think the code is less | ||
# readable in this form. | ||
# | ||
# --modernize-concat-nested-namespaces: clang-tidy recommends | ||
# `namespace google::cloud {}` over `namespace google { namespace cloud { } }` | ||
# We need to support C++14, which does not supported nested namespaces. | ||
# | ||
# --modernize-use-nodiscard: clang-tidy recommends adding a nodiscard annotation | ||
# to functions where the return value should not be ignored. | ||
# We need to support C++14, which does not supported the annotation. | ||
# | ||
# -modernize-return-braced-init-list: We think removing typenames and using | ||
# only braced-init can hurt readability. | ||
# | ||
# -modernize-avoid-c-arrays: We only use C arrays when they seem to be the | ||
# right tool for the job, such as `char foo[] = "hello"`. In these cases, | ||
# avoiding C arrays often makes the code less readable, and std::array is | ||
# not a drop-in replacement because it doesn't deduce the size. | ||
# | ||
# -performance-move-const-arg: This warning requires the developer to | ||
# know/care more about the implementation details of types/functions than | ||
# should be necessary. For example, `A a; F(std::move(a));` will trigger a | ||
# warning IFF `A` is a trivial type (and therefore the move is | ||
# meaningless). It would also warn if `F` accepts by `const&`, which is | ||
# another detail that the caller need not care about. | ||
# | ||
# -performance-avoid-endl: we would like to turn this on, but there are too | ||
# many legitimate uses in our samples. | ||
# | ||
# -readability-redundant-declaration: A friend declaration inside a class | ||
# counts as a declaration, so if we also declare that friend outside the | ||
# class in order to document it as part of the public API, that will | ||
# trigger a redundant declaration warning from this check. | ||
# | ||
# -readability-function-cognitive-complexity: too many false positives with | ||
# clang-tidy-12. We need to disable this check in macros, and that setting | ||
# only appears in clang-tidy-13. | ||
# | ||
# -bugprone-narrowing-conversions: too many false positives around | ||
# `std::size_t` vs. `*::difference_type`. | ||
# | ||
# -bugprone-easily-swappable-parameters: too many false positives. | ||
# | ||
# -bugprone-implicit-widening-of-multiplication-result: too many false positives. | ||
# Almost any expression of the form `2 * variable` or `long x = a_int * b_int;` | ||
# generates an error. | ||
# | ||
# -bugprone-unchecked-optional-access: too many false positives in tests. | ||
# Despite what the documentation says, this warning appears after | ||
# `ASSERT_TRUE(variable)` or `ASSERT_TRUE(variable.has_value())`. | ||
# | ||
# -misc-include-cleaner: too many *true* positives. We need to clean up the | ||
# code, but we should do that over time, maybe per-directory, instead of | ||
# blocking the adoption of Clang 17 until it is all fixed. | ||
# | ||
Checks: > | ||
-*, | ||
abseil-*, | ||
bugprone-*, | ||
google-*, | ||
misc-*, | ||
modernize-*, | ||
performance-*, | ||
portability-*, | ||
readability-*, | ||
-google-readability-braces-around-statements, | ||
-google-readability-namespace-comments, | ||
-google-runtime-references, | ||
-misc-non-private-member-variables-in-classes, | ||
-misc-const-correctness, | ||
-misc-include-cleaner, | ||
-modernize-return-braced-init-list, | ||
-modernize-use-trailing-return-type, | ||
-modernize-concat-nested-namespaces, | ||
-modernize-use-nodiscard, | ||
-modernize-avoid-c-arrays, | ||
-performance-move-const-arg, | ||
-performance-avoid-endl, | ||
-readability-braces-around-statements, | ||
-readability-identifier-length, | ||
-readability-magic-numbers, | ||
-readability-named-parameter, | ||
-readability-redundant-declaration, | ||
-readability-function-cognitive-complexity, | ||
-bugprone-narrowing-conversions, | ||
-bugprone-easily-swappable-parameters, | ||
-bugprone-implicit-widening-of-multiplication-result, | ||
-bugprone-unchecked-optional-access | ||
|
||
# Turn all the warnings from the checks above into errors. | ||
# WarningsAsErrors: "*" | ||
|
||
HeaderFilterRegex: "libsystemctlm-soc/soc/pci/xilinx/xdma.h|libsystemctlm-soc/soc/pci/xilinx/xdma_signal.h" | ||
|
||
CheckOptions: | ||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassCase, value: lower_case } | ||
- { key: readability-identifier-naming.StructCase, value: lower_case } | ||
- { key: readability-identifier-naming.TemplateParameterCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.FunctionCase, value: aNy_CasE } | ||
- { key: readability-identifier-naming.VariableCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassMemberCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassMemberSuffix, value: _ } | ||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } | ||
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ } | ||
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.ConstexprVariablePrefix, value: k } | ||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.GlobalConstantPrefix, value: k } | ||
- { key: readability-identifier-naming.MemberConstantCase, value: CamelCase } | ||
- { key: readability-identifier-naming.MemberConstantPrefix, value: k } | ||
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase } | ||
- { key: readability-identifier-naming.StaticConstantPrefix, value: k } | ||
- { key: readability-implicit-bool-conversion.AllowIntegerConditions, value: 1 } | ||
- { key: readability-implicit-bool-conversion.AllowPointerConditions, value: 1 } | ||
- { key: readability-function-cognitive-complexity.IgnoreMacros, value: 1 } |
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,14 @@ | ||
FROM ubuntu:22.04 | ||
RUN apt-get update && apt-get install -y wget git cloud-image-utils libfdt1 unzip g++ make | ||
ARG DEMO_PATH="/workspaces/cosim_demo" | ||
ARG SYSTEMC_VERSION=systemc-2.3.3 | ||
ARG SYSTEMC_PATH="${DEMO_PATH}/${SYSTEMC_VERSION}" | ||
# get clanged lsp | ||
RUN wget https://github.com/clangd/clangd/releases/download/16.0.2/clangd-linux-16.0.2.zip && \ | ||
unzip clangd-linux-16.0.2.zip && \ | ||
mv clangd_16.0.2/bin/* /bin/ && \ | ||
mv clangd_16.0.2/lib/* /lib/ && \ | ||
rm -r clangd_16.0.2 && rm clangd-linux-16.0.2.zip | ||
RUN mkdir -p $DEMO_PATH && cd $DEMO_PATH && wget -q https://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.3.tar.gz && \ | ||
tar xzf systemc-2.3.3.tar.gz && cd $SYSTEMC_PATH && ./configure --prefix=$SYSTEMC_PATH && \ | ||
make -j && make install |
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,14 @@ | ||
{ | ||
"name": "XDMA SystemC development environment", | ||
"dockerFile": "Dockerfile", | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"llvm-vs-code-extensions.vscode-clangd" | ||
] | ||
} | ||
}, | ||
"runArgs": ["--privileged"] | ||
} | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed comment ?