Skip to content

Commit 38d7ba8

Browse files
authored
Merge pull request #589 from nasa/merge-release-branch-into-main
Merge release branch into main
2 parents 66192a6 + 9bc7dc0 commit 38d7ba8

File tree

20 files changed

+428
-42
lines changed

20 files changed

+428
-42
lines changed

README.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ There is also an FPP plugin available within Visual Studio Code.
2121

2222
See `compiler/README.adoc`.
2323
To use or develop FPP in a standalone mode, you should install these tools.
24-
To use FPP as part of F Prime development, you can install the F Prime tool set,
25-
which includes FPP.
24+
To use FPP as part of F Prime development, you can install the F Prime tool
25+
set, which includes FPP.
2626
See the F Prime installation instructions
27-
https://fprime.jpl.nasa.gov/latest/getting-started/installing-fprime/[here].
27+
https://fprime.jpl.nasa.gov/latest/docs/getting-started/installing-fprime/[here].
2828

2929
=== Spec and User's Guide
3030

compiler/.jvmopts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-XX:+CMSClassUnloadingEnabled
2+
-Xss2M

compiler/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lazy val settings = Seq(
99
"-deprecation",
1010
"-unchecked",
1111
"-Xfatal-warnings",
12-
"-Xmax-inlines:200"
12+
"-Xmax-inlines:100"
1313
),
1414
libraryDependencies ++= dependencies,
1515
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oNCXELOPQRM"),
@@ -110,4 +110,4 @@ lazy val fpp_to_dict = (project in file("tools/fpp-to-dict"))
110110
lazy val fpp_to_layout = (project in file("tools/fpp-to-layout"))
111111
.settings(settings)
112112
.dependsOn(lib)
113-
.enablePlugins(AssemblyPlugin)
113+
.enablePlugins(AssemblyPlugin)

compiler/lib/src/main/scala/analysis/CheckSemantics/CheckComponentDefs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ object CheckComponentDefs
119119
aNode: Ast.Annotated[AstNode[Ast.SpecRecord]]
120120
) = {
121121
val data = aNode._2.data
122-
val record = Record.fromSpecRecord(a, aNode)
123122
for {
124123
idOpt <- a.getNonnegativeBigIntValueOpt(data.id)
124+
record <- Record.fromSpecRecord(a, aNode)
125125
component <- a.component.get.addRecord(idOpt, record)
126126
}
127127
yield a.copy(component = Some(component))

compiler/lib/src/main/scala/analysis/Semantics/Record.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ object Record {
2424

2525
/** Creates a record from a record specifier */
2626
def fromSpecRecord(a: Analysis, aNode: Ast.Annotated[AstNode[Ast.SpecRecord]]):
27-
Record = {
27+
Result.Result[Record] = {
2828
val node = aNode._2
2929
val data = node.data
3030
val recordType = a.typeMap(data.recordType.id)
31-
Record(aNode, recordType, data.isArray)
31+
for {
32+
_ <- a.checkDisplayableType(data.recordType.id, "type of record is not displayable")
33+
}
34+
yield Record(aNode, recordType, data.isArray)
3235
}
3336

3437
}

compiler/lib/src/main/scala/codegen/DictionaryJsonWriter/DictionaryJsonEncoder.scala

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,26 +237,25 @@ case class DictionaryJsonEncoder(
237237
jsonWithOptionalValues(json, optionalValues)
238238
}
239239
case Symbol.Struct(preA, node, postA) => {
240-
val Type.Struct(_, anonStruct, default, sizes, formats) = dictionaryState.a.typeMap(symbol.getNodeId)
241-
val Type.AnonStruct(members) = anonStruct
240+
val Type.Struct(_, _, default, sizes, _) = dictionaryState.a.typeMap(symbol.getNodeId)
242241
val memberFormatMap = node.data.members.flatMap { case (_, memberNode, _) =>
243242
memberNode.data.format.map(format => memberNode.data.name -> format.data)
244243
}.toMap
245244
val memberAnnotationMap = node.data.members.flatMap { case (preA, memberNode, postA) =>
246245
val annotation = (preA ++ postA).mkString("\n")
247246
if (annotation.isEmpty) None else Some(memberNode.data.name -> annotation)
248247
}.toMap
249-
val membersFormatted = for(((key, t), index) <- members.zipWithIndex) yield {
248+
val membersFormatted = for(((_, m, _), index) <- node.data.members.zipWithIndex) yield {
250249
val json = Json.obj(
251-
"type" -> typeAsJson(t).asJson,
250+
"type" -> typeAsJson(dictionaryState.a.typeMap(m.data.typeName.id)),
252251
"index" -> index.asJson
253252
)
254253
val optionalValues = Map(
255-
"size" -> sizes.get(key),
256-
"format" -> memberFormatMap.get(key),
257-
"annotation" -> memberAnnotationMap.get(key)
254+
"size" -> sizes.get(m.data.name),
255+
"format" -> memberFormatMap.get(m.data.name),
256+
"annotation" -> memberAnnotationMap.get(m.data.name)
258257
)
259-
(key.toString -> jsonWithOptionalValues(json, optionalValues))
258+
(m.data.name.toString -> jsonWithOptionalValues(json, optionalValues))
260259
}
261260
val json = Json.obj(
262261
"kind" -> "struct".asJson,
@@ -550,4 +549,4 @@ case class DictionaryJsonEncoder(
550549
}
551550
}
552551

553-
}
552+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module Fw {
2+
3+
port DpRequest
4+
port DpResponse
5+
port DpSend
6+
port Time
7+
8+
}
9+
10+
passive component C {
11+
12+
product request port productRequestOut
13+
sync product recv port productRecvIn
14+
product send port productSendOut
15+
time get port timeGetOut
16+
17+
type A
18+
product container Container
19+
product record R: A id 0x100
20+
21+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fpp-check
2+
[ local path prefix ]/compiler/tools/fpp-check/test/record/not_displayable.fpp:19.21
3+
product record R: A id 0x100
4+
^
5+
error: type of record is not displayable
6+
7+
[ local path prefix ]/compiler/tools/fpp-check/test/record/not_displayable.fpp:17.3
8+
type A
9+
^
10+
Type is defined here

compiler/tools/fpp-check/test/record/tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ missing_container
88
missing_ports
99
missing_product_recv_port
1010
missing_product_send_port
11+
not_displayable
1112
ok
1213
"

compiler/tools/fpp-locate-uses/test/defs.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ constant queue_size_def = 10
7878
constant stack_size_def = 10
7979
constant priority_def = 10
8080
constant cpu_def = 0
81-
type RecordType
8281
constant record_id = 0
82+
array RecordType = [3] U32
8383
constant container_id = 0
8484
constant container_priority = 0
8585
constant product_recv_priority = 0

0 commit comments

Comments
 (0)