forked from Xilinx/mlir-aie
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Xilinx:main' into main
- Loading branch information
Showing
6 changed files
with
89 additions
and
3 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
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,43 @@ | ||
// This file is licensed 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 | ||
// | ||
// (c) Copyright 2024 AMD Inc. | ||
// | ||
// RUN: aie-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s | ||
{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"mlir","capabilities":{},"trace":"off"}} | ||
// ----- | ||
{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{ | ||
"uri":"test:///foo.mlir", | ||
"languageId":"mlir", | ||
"version":1, | ||
"text":"module @example0 {\n%t42 = aie.tile(4, 2)\n%buf42 = aie.buffer(%t42) : memref<256xi32>\n}" | ||
}}} | ||
// ----- | ||
// Hover on an operation. | ||
{"jsonrpc":"2.0","id":1,"method":"textDocument/hover","params":{ | ||
"textDocument":{"uri":"test:///foo.mlir"}, | ||
"position":{"line":1,"character":7} | ||
}} | ||
// CHECK: "id": 1, | ||
// CHECK-NEXT: "jsonrpc": "2.0", | ||
// CHECK-NEXT: "result": { | ||
// CHECK-NEXT: "contents": { | ||
// CHECK-NEXT: "kind": "markdown", | ||
// CHECK-NEXT: "value": "\"aie.tile\"\n\nGeneric Form:\n\n```mlir\n%0 = \"aie.tile\"() <{col = 4 : i32, row = 2 : i32}> : () -> index\n```\n" | ||
// CHECK-NEXT: }, | ||
// CHECK-NEXT: "range": { | ||
// CHECK-NEXT: "end": { | ||
// CHECK-NEXT: "character": 15, | ||
// CHECK-NEXT: "line": 1 | ||
// CHECK-NEXT: }, | ||
// CHECK-NEXT: "start": { | ||
// CHECK-NEXT: "character": 7, | ||
// CHECK-NEXT: "line": 1 | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// CHECK-NEXT: } | ||
// ----- | ||
{"jsonrpc":"2.0","id":7,"method":"shutdown"} | ||
// ----- | ||
{"jsonrpc":"2.0","method":"exit"} |
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
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,18 @@ | ||
# This file is licensed 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 | ||
# | ||
# (c) Copyright 2024 AMD Inc. | ||
|
||
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS) | ||
|
||
set(AIE_LSP_LIBS | ||
${dialect_libs} | ||
MLIRLspServerLib | ||
) | ||
|
||
add_llvm_tool(aie-lsp-server | ||
aie-lsp-server.cpp | ||
) | ||
|
||
target_link_libraries(aie-lsp-server PRIVATE ${AIE_LSP_LIBS}) |
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,23 @@ | ||
//===- aie-lsp-server -------------------------------------------*- C++ -*-===// | ||
// | ||
// This file is licensed 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 | ||
// | ||
// (c) Copyright 2024 AMD Inc. | ||
// | ||
// A server exposing AIE dialects to be used by IDE & editors supporting LSP | ||
// https://microsoft.github.io/language-server-protocol like Emacs, VScode, etc. | ||
//===----------------------------------------------------------------------===// | ||
|
||
#include "mlir/InitAllDialects.h" | ||
#include "mlir/Tools/mlir-lsp-server/MlirLspServerMain.h" | ||
|
||
#include "aie/InitialAllDialect.h" | ||
|
||
int main(int argc, char **argv) { | ||
mlir::DialectRegistry registry; | ||
mlir::registerAllDialects(registry); | ||
xilinx::registerAllDialects(registry); | ||
return mlir::failed(mlir::MlirLspServerMain(argc, argv, registry)); | ||
} |