-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from EDAcation/feat/vhdl-support
VHDL support
- Loading branch information
Showing
14 changed files
with
347 additions
and
41 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,66 @@ | ||
<script lang="ts"> | ||
import {TextField} from '@vscode/webview-ui-toolkit'; | ||
import {type TargetConfiguration, type YosysOptions, getYosysDefaultOptions, getYosysOptions} from 'edacation'; | ||
import {defineComponent} from 'vue'; | ||
import * as vscode from '../../../vscode'; | ||
import {state as globalState} from '../state'; | ||
export default defineComponent({ | ||
props: { | ||
targetIndex: { | ||
type: Number | ||
} | ||
}, | ||
data() { | ||
return { | ||
state: globalState | ||
}; | ||
}, | ||
methods: { | ||
handleTLMChange(event: Event) { | ||
if (!this.target) return; | ||
const newTlm = (event.target as TextField).currentValue; | ||
vscode.vscode.postMessage({ | ||
type: 'changeTlm', | ||
module: newTlm, | ||
targetId: this.target.id | ||
}); | ||
} | ||
}, | ||
computed: { | ||
target(): TargetConfiguration | null { | ||
if (this.targetIndex === undefined) return null; | ||
const targets = this.state.project?.configuration.targets ?? []; | ||
return targets[this.targetIndex] || null; | ||
}, | ||
effectiveOptions(): YosysOptions | null { | ||
if (!this.state.project) return null; | ||
const projectConfig = this.state.project.configuration; | ||
const targetId = this.target?.id; | ||
if (!targetId) { | ||
// Default configuration | ||
return getYosysDefaultOptions(projectConfig); | ||
} else { | ||
// Target configuration | ||
return getYosysOptions(projectConfig, targetId); | ||
} | ||
}, | ||
topLevelModule(): string | null { | ||
return this.effectiveOptions?.topLevelModule ?? null; | ||
} | ||
} | ||
}); | ||
</script> | ||
|
||
<template> | ||
<vscode-text-field placeholder="Automatic (Verilog only)" :value="topLevelModule" @input="handleTLMChange"> | ||
Top-level module | ||
</vscode-text-field> | ||
</template> | ||
|
||
<style scoped></style> |
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.