LOC constraint value - xilinx

I'm trying to program a constraints file for a XC2C256-7VQ100, hence I used a line like follows:
NET "led_1" LOC=7;
However with the above I get an error during translate saying:
Error: Constraint 'LOC' has a value '7' which is invalid. Use the following:
Text that matches the regular expression: *i!:^(soft)|(hard)|(level)$
However I cannot find anywhere information on what soft/hard/level means and/or why I can't just use the pin number specified in the XC2C256 data sheet. Could someone shed some light on this for me?
Thanks.

The correct syntax for LOC is:
NET "LED_1" LOC = "7";
Try this, and I am sure your problem will be solved.

Related

Why we are unable to evaluate comprehension if we have defined it inside a rule body in OPA?

The following is my sample code: https://play.openpolicyagent.org/p/oyY1GOsYaf
Here when I try to evaluate names array, it is showing:
error occurred: 1:1: rego_unsafe_var_error: var names is unsafe
But when I define the same comprehension outside the allow rule definition : https://play.openpolicyagent.org/p/Xv0cF7FM8b, I am able to evaluate the selection
[
"smoke",
"dev"]
could someone help me to point out the difference and if I want to define the comprehention inside the rule is there any syntax I need to follow? Thanks in advance
Note: I am getting the final output as expected in both cases, only issue is with the names array evaluation.
The way the Rego Playground generates a query when evaluating a selection is much more simplistic than one might assume. A query will be generated from your selected text, without taking into account where in the document that text was selected. This means that even if you select a local variable inside a rule body, the query will simply contain that variable name (names, in your case); which will be perceived as a reference to a top-level variable in the document's body, even though a rule-local variable was selected. This is why your first sample returns an error, as there is no top-level variable names in the document; whereas the second sample does, and therefore succeeds.
You can test this quirk by selecting and evaluating the word hello on line 3 here: https://play.openpolicyagent.org/p/n5OPoFnlhx.
package play
# hello
hello {
m := input.message
m == "world"
}
Even though it's just part of a comment, it'll evaluate just as if you had selected the rule name on line 5.

Expected rel[loc,loc] (...), but got rel[loc,loc], what does rel[loc,loc](...) mean?

I just tested my code to build the dot diagram, when I tried to union two relations together and passed the the sumed up relation, following error is reported:
Expected rel[loc,loc] (...), but got rel[loc,loc]
I am not sure what relloc, loc means because each of the separated relations works correctly. Could please you tell me why?
Yes, that message can be confusing!
rel[loc,loc] (...) means a type of function which returns a rel[loc,loc] given some arguments ... which are unspecified in this message
rel[loc,loc] is just the type of a binary relation of loc
We sometimes see this kind of message occurring when ( ) brackets are used accidentally instead of [ ] for indexing into a relation. If you provide a little more context code, maybe we can diagnose the issue from that more precisely.

Country Colouring F#

I keep getting
'Block following this 'let' is unfinished. Expect an expression'
when trying to compute a function.
Here is my code:
let colourTheCountries (chart: Chart) =
Set.fold(extColouring chart) Set.empty Set.empty
How do I terminate the expression?
I want the value of the Set.fold to be the result.
After looking around on the internet I couldn't figure out why I was getting this error. I notice a function that was previously working below this one was also getting an error.
Turns out the functions above was indented by an extra space.

Bug in my regular expression

I'm trying to look at a string and reject anything that has seq= or app= in the string. Where it gets tricky is I need elements with q=something or p=something.
The seq= part of the string is always preceded an & and app= is always preceded by a ?
I have absolutely no idea where to start. I've been using http://www.rubular.com/ to try and figure it out but to no avail.
Any help would be hugely appreciated.
Based on your question, I believe you could just reject any strings that match the following expression:
[\?&](?:seq|app)=
This will match any string that contains a ? or & followed by either app= or seq=. The ?: inside the parentheses just tells the regular expression not to bother to capture matching groups as sub-matches. They're not really necessary, but what the heck.
Here's a Rubular link with some samples.

Lua pattern matching: problem specifying the pattern to match

I am attempting some pattern matching in Lua and have hit a small problem. I am trying to match everything from the first newline character in my data up to the following pattern _\x0C.
here is the code that has the problem:
configmatch = string.match(response, "\n(.+)(['_\x0C'])")
it seems to be working some of the time, other times it is "cutting short" the expected output. the problem is probably to do with this: (['_\x0C']) but i have been unable to resolve it. Does anyone know how to fix this?
If you want _\x0C literally in the string, you need to use "\n(.-_\\x0C)". If you mean underscore followed by formfeed, use "\n(.-_\012)", because there are no \x escapes in Lua (5.1).

Resources