From 0e4b33a965e8eabb687ba07580be749e5f0ffe4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Zrounba?= Date: Thu, 7 Dec 2023 10:47:23 +0000 Subject: 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 ` * Parameters: none --- src/parser/parser.l | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/parser/parser.l') 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; } -- cgit v1.2.3