aboutsummaryrefslogtreecommitdiff
path: root/src/parser/parser.l
diff options
context:
space:
mode:
authorClément Zrounba <clement.zrounba@ec-lyon.fr>2023-12-07 10:47:23 +0000
committerClément Zrounba <clement.zrounba@ec-lyon.fr>2023-12-07 10:48:56 +0000
commit0e4b33a965e8eabb687ba07580be749e5f0ffe4c (patch)
treec5dfd6564a6b8809dd23aba06e5b165af7bbe766 /src/parser/parser.l
parent4b1c60c90936b52093d287f59eb118f93bc82407 (diff)
downloadspecs-0e4b33a965e8eabb687ba07580be749e5f0ffe4c.tar.gz
specs-0e4b33a965e8eabb687ba07580be749e5f0ffe4c.zip
Add power meter element to measure DC optical power
This device replaces photodetector in cases where the DC power should be measured efficiently, without considering realistic effects (bandwidth, noise, responsivity...). * Syntax in netlist: `PWRnnnn <optical net>` * Parameters: none
Diffstat (limited to 'src/parser/parser.l')
-rw-r--r--src/parser/parser.l6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parser/parser.l b/src/parser/parser.l
index 04a820a..e104b56 100644
--- a/src/parser/parser.l
+++ b/src/parser/parser.l
@@ -450,6 +450,12 @@ string convert_special_char(char c)
return T_ELEM_PCMCELL;
}
+^PWR({ALPHA_PLUS_NUM})+ {
+ /* Power meter instance */
+ yylval_param->s_ptr = new string(yytext);
+ return T_ELEM_PWR_METER;
+}
+
^\.ASSIGN { return T_LOCAL_ASSIGNMENT; }
^\.PARAM { return T_LOCAL_ASSIGNMENT; }
^\.SAVE { return T_DIRECTIVE_SAVE; }