@mchp-mcc/scf-pic8-clc-v1 4.0.13 → 4.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/Changelog.md +9 -0
  2. package/Readme.md +9 -0
  3. package/output/autoCreator.js +167 -3
  4. package/output/autoCreator.js.map +1 -1
  5. package/output/autoProcessor.js +167 -3
  6. package/output/autoProcessor.js.map +1 -1
  7. package/output/creator.js +167 -3
  8. package/output/creator.js.map +1 -1
  9. package/output/processor.js +167 -3
  10. package/output/processor.js.map +1 -1
  11. package/output/reducer.js +1 -1
  12. package/output/view.js +1 -1
  13. package/package.json +6 -8
  14. package/src/App.tsx +0 -101
  15. package/src/Constants.ts +0 -181
  16. package/src/CreatorFunctions.ts +0 -44
  17. package/src/DerivedData.test.tsx +0 -285
  18. package/src/DerivedData.ts +0 -444
  19. package/src/GeneratorModel.test.ts +0 -57
  20. package/src/GeneratorModel.ts +0 -60
  21. package/src/InputStateCalculator.test.ts +0 -64
  22. package/src/InputStateCalculator.ts +0 -50
  23. package/src/PinsLogic.test.ts +0 -514
  24. package/src/PinsLogic.ts +0 -164
  25. package/src/SettingNameCalculator.test.ts +0 -21
  26. package/src/SettingNameCalculator.ts +0 -28
  27. package/src/actions.ts +0 -22
  28. package/src/catalog.json +0 -24
  29. package/src/components/CLCView.tsx +0 -141
  30. package/src/components/Canvas.tsx +0 -757
  31. package/src/components/InputSource.tsx +0 -24
  32. package/src/components/InputStage.tsx +0 -55
  33. package/src/components/MX.ts +0 -12
  34. package/src/gates/ALogicGate.ts +0 -221
  35. package/src/gates/AndGate.ts +0 -36
  36. package/src/gates/GateInputState.ts +0 -1
  37. package/src/gates/Latch.ts +0 -93
  38. package/src/gates/NotGate.ts +0 -37
  39. package/src/gates/OrGate.ts +0 -134
  40. package/src/gates/XorGate.ts +0 -12
  41. package/src/index.tsx +0 -51
  42. package/src/interfaces/cla-clc-stacked.test.ts +0 -61
  43. package/src/interfaces/cla-clc-stacked.ts +0 -181
  44. package/src/interfaces/clc-connections.tsx +0 -62
  45. package/src/interfaces/signal-source.ts +0 -78
  46. package/src/interfaces/trigger-source.ts +0 -78
  47. package/src/moduleConfig.json +0 -882
  48. package/src/pinsdata.json +0 -151
  49. package/src/reducer.test.tsx +0 -118
  50. package/src/reducer.tsx +0 -80
package/src/pinsdata.json DELETED
@@ -1,151 +0,0 @@
1
- {
2
- "rows": [
3
- {
4
- "name": "clcout",
5
- "module": "CLC1",
6
- "function": "CLC1",
7
- "direction": "output",
8
- "filter": {
9
- "module": "CLC1",
10
- "aliasReEx": "CLC1"
11
- },
12
- "behaviour": "PPS"
13
- },
14
- {
15
- "name": "clcin0",
16
- "module": "CLCx",
17
- "function": "CLCIN0",
18
- "direction": "input",
19
- "filter": {
20
- "module": "CLC1",
21
- "aliasReEx": "CLCIN0"
22
- },
23
- "behaviour": "PPS",
24
- "attribs": [
25
- {
26
- "aliasReEx": ".*",
27
- "analog": false
28
- }
29
- ]
30
- },
31
- {
32
- "name": "clcin1",
33
- "module": "CLCx",
34
- "function": "CLCIN1",
35
- "direction": "input",
36
- "filter": {
37
- "module": "CLC1",
38
- "aliasReEx": "CLCIN1"
39
- },
40
- "behaviour": "PPS",
41
- "attribs": [
42
- {
43
- "aliasReEx": ".*",
44
- "analog": false
45
- }
46
- ]
47
- },
48
- {
49
- "name": "clcin2",
50
- "module": "CLCx",
51
- "function": "CLCIN2",
52
- "direction": "input",
53
- "filter": {
54
- "module": "CLC1",
55
- "aliasReEx": "CLCIN2"
56
- },
57
- "behaviour": "PPS",
58
- "attribs": [
59
- {
60
- "aliasReEx": ".*",
61
- "analog": false
62
- }
63
- ]
64
- },
65
- {
66
- "name": "clcin3",
67
- "module": "CLCx",
68
- "function": "CLCIN3",
69
- "direction": "input",
70
- "filter": {
71
- "module": "CLC1",
72
- "aliasReEx": "CLCIN3"
73
- },
74
- "behaviour": "PPS",
75
- "attribs": [
76
- {
77
- "aliasReEx": ".*",
78
- "analog": false
79
- }
80
- ]
81
- },
82
- {
83
- "name": "clcin4",
84
- "module": "CLCx",
85
- "function": "CLCIN4",
86
- "direction": "input",
87
- "filter": {
88
- "module": "CLC1",
89
- "aliasReEx": "CLCIN4"
90
- },
91
- "behaviour": "PPS",
92
- "attribs": [
93
- {
94
- "aliasReEx": ".*",
95
- "analog": false
96
- }
97
- ]
98
- },
99
- {
100
- "name": "clcin5",
101
- "module": "CLCx",
102
- "function": "CLCIN5",
103
- "direction": "input",
104
- "filter": {
105
- "module": "CLC1",
106
- "aliasReEx": "CLCIN5"
107
- },
108
- "behaviour": "PPS",
109
- "attribs": [
110
- {
111
- "aliasReEx": ".*",
112
- "analog": false
113
- }
114
- ]
115
- },
116
- {
117
- "name": "clcin6",
118
- "module": "CLCx",
119
- "function": "CLCIN6",
120
- "direction": "input",
121
- "filter": {
122
- "module": "CLC1",
123
- "aliasReEx": "CLCIN6"
124
- },
125
- "behaviour": "PPS",
126
- "attribs": [
127
- {
128
- "aliasReEx": ".*",
129
- "analog": false
130
- }
131
- ]
132
- },
133
- {
134
- "name": "clcin7",
135
- "module": "CLCx",
136
- "function": "CLCIN7",
137
- "direction": "input",
138
- "filter": {
139
- "module": "CLC1",
140
- "aliasReEx": "CLCIN7"
141
- },
142
- "behaviour": "PPS",
143
- "attribs": [
144
- {
145
- "aliasReEx": ".*",
146
- "analog": false
147
- }
148
- ]
149
- }
150
- ]
151
- }
@@ -1,118 +0,0 @@
1
- import { clcReduce, reduce } from "./reducer";
2
- import { State } from "../generated_module/src/types/State";
3
- import { updateGatePolarity } from "./actions";
4
- import { createSubmitAction } from "@microchip/scf-autoview/lib/simpleForm/actions";
5
-
6
- describe("The CLC reducer", () => {
7
- it("Updates gate polarity", () => {
8
- const state: State = {
9
- main: {
10
- hardware: {
11
- lcg1d1nClcgls0: false,
12
- lcg1d1tClcgls0: true,
13
- },
14
- },
15
- };
16
-
17
- const newState: State = {
18
- main: {
19
- hardware: {
20
- lcg1d1nClcgls0: true,
21
- lcg1d1tClcgls0: false,
22
- },
23
- },
24
- };
25
-
26
- expect(clcReduce(state, updateGatePolarity(1, 1))).toStrictEqual(newState);
27
- });
28
-
29
- it("Does not change other parts of the state when updating", () => {
30
- const state: State = {
31
- main: {
32
- interrupt: {
33
- clci: true,
34
- lcintpClccon: true,
35
- },
36
- hardware: {
37
- lcg1polClcpol: "inverted",
38
- lcd1sClcsel0: "HFINTOSC",
39
- lcg1d4nClcgls0: false,
40
- lcg1d4tClcgls0: false,
41
- lcg1d1nClcgls0: false,
42
- lcg1d1tClcgls0: true,
43
- },
44
- software: {
45
- componentName: "CLC1z",
46
- },
47
- },
48
- };
49
-
50
- const newState: State = {
51
- main: {
52
- interrupt: {
53
- clci: true,
54
- lcintpClccon: true,
55
- },
56
- hardware: {
57
- lcg1polClcpol: "inverted",
58
- lcd1sClcsel0: "HFINTOSC",
59
- lcg1d4nClcgls0: false,
60
- lcg1d4tClcgls0: true,
61
- lcg1d1nClcgls0: false,
62
- lcg1d1tClcgls0: true,
63
- },
64
- software: {
65
- componentName: "CLC1z",
66
- },
67
- },
68
- };
69
-
70
- expect(clcReduce(state, updateGatePolarity(1, 4))).toStrictEqual(newState);
71
- });
72
-
73
- it("Updates state on startup", () => {
74
- const state = {};
75
- const newState: State = {
76
- main: {
77
- hardware: {
78
- lcg4d4nClcgls3: false,
79
- lcg4d4tClcgls3: true,
80
- },
81
- },
82
- };
83
- expect(clcReduce(state, updateGatePolarity(4, 4))).toStrictEqual(newState);
84
- });
85
-
86
- it("Does not change state when given unknown action", () => {
87
- const state = {};
88
- expect(
89
- clcReduce(state, createSubmitAction("main", "hardware.lcg4d4nClcgls3", true)),
90
- ).toStrictEqual(state);
91
- });
92
-
93
- it("Takes the default assigned value for gate and input", () => {
94
- const state = {
95
- main: undefined,
96
- hardware: undefined,
97
- };
98
- expect(clcReduce(state, { type: "UPDATE_GATE_POLARITY" })).toEqual({
99
- main: { hardware: { lcg1d1nClcgls0: false, lcg1d1tClcgls0: true } },
100
- });
101
- });
102
-
103
- it("reduce switch test-1", () => {
104
- const state = {};
105
- expect(reduce(state, { type: "UPDATE_GATE_POLARITY" })).toStrictEqual({
106
- main: { hardware: { lcg1d1nClcgls0: false, lcg1d1tClcgls0: true } },
107
- });
108
- });
109
- it("reduce switch test-2", () => {
110
- const state = {};
111
- expect(reduce(state, { type: "UNKNOWN" })).toStrictEqual(state);
112
- });
113
-
114
- it("reduce switch test-3", () => {
115
- const state = {};
116
- expect(reduce(state, { type: "[FORM] SUBMIT" })).toStrictEqual(state);
117
- });
118
- });
package/src/reducer.tsx DELETED
@@ -1,80 +0,0 @@
1
- /*
2
- * @license:
3
- * © 2019 Microchip Technology Inc. and its subsidiaries.
4
- *
5
- * You may use this software and any derivatives exclusively with Microchip products.
6
- *
7
- * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS,
8
- * IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF
9
- * NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE, OR ITS
10
- * INTERACTION WITH MICROCHIP PRODUCTS, COMBINATION WITH ANY OTHER PRODUCTS, OR USE
11
- * IN ANY APPLICATION.
12
- *
13
- * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL
14
- * OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO
15
- * THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY
16
- * OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S
17
- * TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED
18
- * THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
19
- *
20
- * MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE TERMS.
21
- */
22
- import * as Auto from "@microchip/scf-autoview-impl/src/lib/reducer/reducer";
23
- import { Actions } from "@microchip/scf-autoview/lib/simpleForm/actions";
24
- import { CLCActions, CLCAction } from "./actions";
25
- import { InputStateCalculator } from "./InputStateCalculator";
26
- import { State } from "../generated_module/src/types/State";
27
- import {
28
- getGateNonInvertedSetting,
29
- getGateInvertedSetting,
30
- } from "./SettingNameCalculator";
31
- import { Action } from "@microchip/scf-common";
32
-
33
- export const reduce = (state: State, action: Action<any, any>): State => {
34
- switch (action.type) {
35
- case Actions.SUBMIT_FORM:
36
- return Auto.reduce(state, action);
37
- case CLCActions.UPDATE_GATE_POLARITY:
38
- return clcReduce(state, action);
39
- default:
40
- return Auto.reduce(state, action);
41
- }
42
- };
43
-
44
- export const clcReduce = (state: State, action: Action<any, any>): State => {
45
- switch (action.type) {
46
- case CLCActions.UPDATE_GATE_POLARITY:
47
- return updateGatePolarity(state, action);
48
- default:
49
- return state;
50
- }
51
- };
52
-
53
- const updateGatePolarity = (state: State, action: CLCAction): State => {
54
- const gate = action.payload?.gate ?? 1;
55
- const input = action.payload?.input ?? 1;
56
- const gateNonInvertedSetting = getGateNonInvertedSetting(gate, input);
57
- const gateInvertedSetting = getGateInvertedSetting(gate, input);
58
-
59
- const currentNonInverted = state.main?.hardware?.[gateNonInvertedSetting];
60
- const currentInverted = state.main?.hardware?.[gateInvertedSetting];
61
-
62
- const curr = InputStateCalculator.getInputState(currentNonInverted, currentInverted);
63
- const stateNew = InputStateCalculator.getNextState(curr);
64
-
65
- const { inverted, nonInverted } = InputStateCalculator.getLogicSelection(stateNew);
66
-
67
- const newState: State = {
68
- ...state,
69
- main: {
70
- ...state.main,
71
- hardware: {
72
- ...state.main?.hardware,
73
- [gateInvertedSetting]: inverted,
74
- [gateNonInvertedSetting]: nonInverted,
75
- },
76
- },
77
- };
78
-
79
- return newState;
80
- };