-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configuration App & Configurators (#56)
- Loading branch information
Showing
66 changed files
with
2,342 additions
and
191 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
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,50 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Android Studio will place build artifacts here | ||
/android/app/debug | ||
/android/app/profile | ||
/android/app/release | ||
|
||
android | ||
ios | ||
linux | ||
macos | ||
windows |
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,45 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled. | ||
|
||
version: | ||
revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
channel: stable | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
- platform: android | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
- platform: ios | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
- platform: linux | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
- platform: macos | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
- platform: web | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
- platform: windows | ||
create_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
base_revision: 796c8ef79279f9c774545b3771238c3098dbefab | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
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,15 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Flutter: Run all Tests", | ||
"type": "dart", | ||
"request": "launch", | ||
"program": "./test/", | ||
"args": ["--platform", "chrome"] | ||
}, | ||
] | ||
} |
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,10 @@ | ||
# ROHD-HCL Flutter Configuration App | ||
|
||
This is a web app that allows RTL generation (SystemVerilog) based on the specific configuration. | ||
|
||
## Widget Tree | ||
|
||
```mermaid | ||
flowchart TD; | ||
HCLAPP:material_widget-->HCLPage:register_cubit-->HCLView-->MainPage --> ComponentSideBar:Nav & SVGenerator:Content | ||
``` |
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,6 @@ | ||
|
||
include: package:flutter_lints/flutter.yaml | ||
|
||
linter: | ||
rules: | ||
|
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,19 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// app.dart | ||
// Main app | ||
// | ||
// 2023 December | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:confapp/hcl/hcl.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
class HCLApp extends MaterialApp { | ||
HCLApp({super.key, required List<Configurator> components}) | ||
: super( | ||
home: HCLPage( | ||
components: components, | ||
)); | ||
} |
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,26 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// component_cubit.dart | ||
// Implementation of a cubit for Configurators | ||
// | ||
// 2023 December | ||
|
||
import 'package:bloc/bloc.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
|
||
/// Controls the selected component. | ||
class ComponentCubit extends Cubit<Configurator> { | ||
Configurator selectedComponent; | ||
|
||
final List<Configurator> components; | ||
|
||
ComponentCubit(this.components) | ||
: selectedComponent = components.first, | ||
super(components.first); | ||
|
||
void setSelectedComponent(Configurator selectedComponent) { | ||
this.selectedComponent = selectedComponent; | ||
emit(selectedComponent); | ||
} | ||
} |
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,56 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// system_verilog_cubit.dart | ||
// Implementation of a cubit for generating verilog | ||
// | ||
// 2023 December | ||
|
||
import 'package:bloc/bloc.dart'; | ||
|
||
enum GenerationState { initial, loading, done } | ||
|
||
class SystemVerilogCubitState { | ||
final String systemVerilog; | ||
final GenerationState generationState; | ||
final String name; | ||
|
||
const SystemVerilogCubitState( | ||
{required this.systemVerilog, | ||
required this.generationState, | ||
required this.name}); | ||
const SystemVerilogCubitState.loading() | ||
: this( | ||
systemVerilog: 'Loading...', | ||
generationState: GenerationState.loading, | ||
name: 'loading'); | ||
const SystemVerilogCubitState.done(String systemVerilog, String name) | ||
: this( | ||
systemVerilog: systemVerilog, | ||
generationState: GenerationState.done, | ||
name: name); | ||
const SystemVerilogCubitState.initial() | ||
: this( | ||
systemVerilog: 'Click "Generate RTL"!', | ||
generationState: GenerationState.initial, | ||
name: 'init'); | ||
} | ||
|
||
/// Controls the generated SystemVerilog to display | ||
class SystemVerilogCubit extends Cubit<SystemVerilogCubitState> { | ||
SystemVerilogCubit() : super(const SystemVerilogCubitState.loading()) { | ||
initializeData(); | ||
} | ||
|
||
void initializeData() async { | ||
emit(const SystemVerilogCubitState.initial()); | ||
} | ||
|
||
void setLoading() { | ||
emit(const SystemVerilogCubitState.loading()); | ||
} | ||
|
||
void setRTL(String rtl, String name) { | ||
emit(SystemVerilogCubitState.done(rtl, name)); | ||
} | ||
} |
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,4 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
export 'view/hcl_page.dart'; |
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,37 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
// hcl_page.dart | ||
// Main page for the app | ||
// | ||
// 2023 December | ||
|
||
import 'package:confapp/hcl/cubit/system_verilog_cubit.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_bloc/flutter_bloc.dart'; | ||
import 'package:confapp/hcl/cubit/component_cubit.dart'; | ||
import 'package:rohd_hcl/rohd_hcl.dart'; | ||
import 'hcl_view.dart'; | ||
|
||
class HCLPage extends StatelessWidget { | ||
final List<Configurator> components; | ||
|
||
/// {@macro counter_page} | ||
const HCLPage({super.key, required this.components}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MultiBlocProvider( | ||
providers: [ | ||
BlocProvider( | ||
// Look pretty ungly using static, not sure how to improve this | ||
create: (BuildContext context) => ComponentCubit(components), | ||
), | ||
BlocProvider( | ||
create: (BuildContext context) => SystemVerilogCubit(), | ||
), | ||
], | ||
child: const HCLView(), | ||
); | ||
} | ||
} |
Oops, something went wrong.